mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-07 00:39:44 -06:00
63 lines
1.3 KiB
Plaintext
63 lines
1.3 KiB
Plaintext
#!/usr/bin/expect
|
|
|
|
set timeout 3
|
|
spawn dolt sql
|
|
|
|
# This script uses undefined variables in the failure case so that
|
|
# error output includes the line of the failed test expectation
|
|
|
|
expect {
|
|
"*doltsql> " { send -- "use `doltsql/test`;\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|
|
|
|
expect {
|
|
"*doltsql/test> " { send -- "show tables;\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|
|
|
|
expect {
|
|
"*doltsql/test> " { send -- "use information_schema;\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|
|
|
|
expect {
|
|
"*information_schema> " { send -- "show tables;\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|
|
|
|
expect {
|
|
"*information_schema> " { send -- "CREATE DATABASE mydb;\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|
|
|
|
expect {
|
|
"*information_schema> " { send -- "use db1;\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|
|
|
|
expect {
|
|
-re "|.*db1.*|\r.*db1> " { send -- "select database();\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|
|
|
|
expect {
|
|
"*db1>" { send -- "use db2;\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|
|
|
|
expect {
|
|
"*db2> " { send -- "select database();\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|
|
|
|
expect {
|
|
-re "|.*db2.*|.*\rdb2>" { send -- "use mydb;\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|
|
|
|
expect {
|
|
"mydb> " { send -- "exit ;\r"; }
|
|
timeout { puts "$TESTFAILURE"; }
|
|
}
|