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
1021 B
Plaintext

#!/usr/bin/expect
set timeout 3
spawn dolt sql
# This test uses an undefined var for its failure case, which gives
# the line number of the failure in the output.
expect {
"> " { send "show tables\\G\r"; }
timeout { puts "$TEST_FAILURE" }
}
expect {
"*: one_pk*" { send "DELIMITER $$\r"; }
timeout { puts "$TEST_FAILURE" }
}
expect {
"> " { send "show tables$$\r"; }
timeout { puts "$TEST_FAILURE" }
}
expect {
"*| one_pk*" { send "show tables\\g\r"; }
timeout { puts "$TEST_FAILURE" }
}
expect {
"*: one_pk*" { send "DELIMITER ;\r"; }
timeout { puts "$TEST_FAILURE" }
}
expect {
"> " { send "SELECT COUNT(*) FROM one_pk\\G\r"; }
timeout { puts "$TEST_FAILURE" }
}
expect {
"*COUNT(\\*): 4*" { send "SELECT JSON_OBJECT('id', 87, 'name', 'carrot')\\G\r"; }
timeout { puts "$TEST_FAILURE" }
}
expect {
"*JSON_OBJECT('id', 87, 'name', 'carrot'): {\"id\": 87, \"name\": \"carrot\"}*" { exit 0 ; }
timeout { puts "$TEST_FAILURE" }
failed { puts "$TEST_FAILURE" }
}
expect eof