Testing changes

This commit is contained in:
Nathan Gabrielson
2025-05-22 13:00:41 -07:00
parent 98d9763e7e
commit 46ecdac992
2 changed files with 26 additions and 0 deletions

View File

@@ -50,6 +50,16 @@ teardown() {
! [[ "$output" =~ "1 row in set, 3 warnings" ]] || false
}
# bats test_tabs=no_lambda
@test "sql-shell: show warnings hides warning summary, and removes whitespace" {
skiponwindows "Need to install expect and make this script work on windows."
run $BATS_TEST_DIRNAME/sql-show-warnings.expect
echo "$output"
[ "$status" -eq 0 ]
}
@test "sql-shell: use user without privileges, and no superuser created" {
rm -rf .doltcfg

View File

@@ -0,0 +1,16 @@
#!/usr/bin/expect
set timeout 5
set env(NO_COLOR) 1
source "$env(BATS_CWD)/helper/common_expect_functions.tcl"
spawn dolt sql
expect_with_defaults {dolt-repo-.*} { send " shoW warNinGs ; \r"; }
expect_with_defaults_2 {Empty set} {dolt-repo-.*} { send "select 1/0;\r"; }
expect_with_defaults {dolt-repo-.*} { send " shoW warNinGs ; \r"; }
expect_with_defaults_2 {Division by 0 } {dolt-repo-.*} { send "exit;\r"; }