mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-08 11:21:17 -05:00
More tests
This commit is contained in:
@@ -48,7 +48,11 @@ setup_no_dolt_init() {
|
||||
|
||||
assert_feature_version() {
|
||||
run dolt version --feature
|
||||
[[ "$output" =~ "feature version: 2" ]] || exit 1
|
||||
# Tests that don't end in a valid dolt dir will fail the above
|
||||
# command, don't check its output in that case
|
||||
if [ "$status" -eq 0 ]; then
|
||||
[[ "$output" =~ "feature version: 2" ]] || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
setup_common() {
|
||||
|
||||
@@ -618,6 +618,9 @@ SQL
|
||||
@test "sql: run outside a dolt directory" {
|
||||
mkdir new && cd new
|
||||
|
||||
mkdir decoy
|
||||
touch decoy/file.txt
|
||||
|
||||
dolt sql --disable-batch <<SQL
|
||||
CREATE DATABASE test1;
|
||||
USE test1;
|
||||
@@ -643,11 +646,29 @@ SQL
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "test1" ]] || false
|
||||
[[ "$output" =~ "information_schema" ]] || false
|
||||
|
||||
# We have to end in a valid dolt database directory for teardown to succeed
|
||||
cd ..
|
||||
[[ ! "$output" =~ "decoy" ]] || false
|
||||
}
|
||||
|
||||
@test "sql: bad dolt db" {
|
||||
mkdir new && cd new
|
||||
|
||||
mkdir -p decoy/.dolt/noms/oldgen
|
||||
mkdir -p decoy/.dolt/noms/temptf
|
||||
echo '{}' > decoy/config.json
|
||||
|
||||
# Not doing this cd ../ results in the teardown method failing on
|
||||
# a skip, not sure why. It's not part of the actual test
|
||||
cd ../
|
||||
skip "This results in a panic right now"
|
||||
|
||||
run dolt sql -q "show databases" -r csv
|
||||
[ "$status" -eq 0 ]
|
||||
[ "${#lines[@]}" -eq 2 ]
|
||||
[[ "$output" =~ "information_schema" ]] || false
|
||||
[[ ! "$output" =~ "decoy" ]] || false
|
||||
}
|
||||
|
||||
|
||||
@test "sql: set head ref session var" {
|
||||
dolt add .; dolt commit -m 'commit tables'
|
||||
dolt checkout -b feature-branch
|
||||
|
||||
Reference in New Issue
Block a user