Files
wehub-resource-sync 5357c39144
Fuzzer / Run Fuzzer (push) Has been cancelled
Race tests / Go race tests (ubuntu-22.04) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:01:40 +08:00

51 lines
1.1 KiB
Plaintext
Executable File

#!/usr/bin/expect
set timeout 5
spawn dolt sql
expect {
-re "> " { send "create database mydb;\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
-re "> " { send "use mydb;\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
-re ".*mydb.*/.*main.*> " { send "create table tbl (i int);\r"; }
timeout { exit 1; }
failed { exit 1; }
}
# Dirty workspace should show in prompt as a "*" before the ">"
# (all the .* instances here are to account for ansi colors chars.
expect {
-re ".*mydb.*/.*main.*\\*.*> " { send "call dolt_commit('-Am', 'msg');\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
-re ".*mydb.*/.*main.*> " { send "call dolt_checkout('-b','other','HEAD');\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
-re ".*mydb.*/.*main.*> " { send "use mysql;\r"; }
timeout { exit 1; }
failed { exit 1; }
}
# using a non dolt db should result in a prompt without a slash. The brackets
# are required to get expect to properly parse this regex.
expect {
-re {.*mysql[^\\/]*> } { send "exit;\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect eof