test updates

This commit is contained in:
Nathan Gabrielson
2025-05-15 09:37:26 -07:00
parent 13c41b6950
commit d31bee5a94
2 changed files with 7 additions and 21 deletions

View File

@@ -21,13 +21,9 @@ teardown() {
teardown_common
}
# bats test_tags=no_lambda
@test "sql-shell: warnings are not suppressed" {
skiponwindows "Need to install expect and make this script work on windows."
if [ "$SQL_ENGINE" = "remote-engine" ]; then
skip "session ctx in shell is no the same as session in server"
fi
run $BATS_TEST_DIRNAME/sql-shell-warnings.expect
echo "$output"
@@ -36,15 +32,17 @@ teardown() {
[[ "$output" =~ "Division by 0" ]] || false
}
# bats test_tags=no_lambda
@test "sql-shell: can toggle warning details" {
skiponwindows "Need to install expect and make this script work on windows."
run $BATS_TEST_DIRNAME/sql-warning-summary.expect
[[ "$output" =~ "EXPLAIN Output is currently a placeholder" ]] || false
[ "$status" -eq 0 ]
! [[ "$output" =~ "Warning (Code 1365): Division by 0" ]] || false
}
# bats test_tags=no_lambda
@test "sql-shell: can toggle warning summary" {
skiponwindows "Need to install expect and make this script work on windows."

View File

@@ -7,24 +7,12 @@ source "$env(BATS_CWD)/helper/common_expect_functions.tcl"
spawn dolt sql
expect {
-re "dolt-repo-.*> " {send "explain select * from test;\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect_with_defaults {dolt-repo-.*>} { send "explain select * from t;"; }
expect_with_defaults {dolt-repo-.*>} { send "\\w\r"; }
expect_with_defaults_2 {EXPLAIN output is currently a placeholder} {dolt-repo-.*>} { send "\\w\r"; }
expect {
-re "dolt-repo-.*> " { send "select 1/0;\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect_with_defaults_2 {Show warnings disabled} {dolt-repo-.*>} { send "select 1/0;"; }
expect {
-re "dolt-repo-.*> " { send "exit;\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect_with_defaults {dolt-repo-.*>} { send "exit;"; }
expect eof