Skip to content

Commit

Permalink
cli/interactive_tests: make test_client_side_checking easier to run l…
Browse files Browse the repository at this point in the history
…ocally

Sometimes the shell invoked by `expect` adds additional escape
characters in-between the output of a process and the next prompt.
This patch makes the test more robust in that case.

Release note: None
  • Loading branch information
knz committed Apr 10, 2023
1 parent c7a932a commit 27c0a29
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/cli/interactive_tests/test_client_side_checking.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,18 @@ send "(echo '\\unset errexit'; echo 'begin;'; echo 'select 1+;'; echo 'select 1;
eexpect "syntax error"
eexpect "current transaction is aborted"
eexpect ":/# "
send "echo \$?\r"
eexpect "1\r\n:/# "
send "echo ::\$?::\r"
eexpect "::1::"
eexpect ":/# "

send "(echo '\\unset errexit'; echo '\\set check_syntax'; echo 'begin;'; echo 'select 1+;'; echo 'select 1;'; echo 'commit;') | $argv sql\r"
eexpect "syntax error"
eexpect "1 row"
eexpect "COMMIT"
eexpect ":/# "
send "echo \$?\r"
eexpect "0\r\n:/# "
send "echo ::\$?::\r"
eexpect "::0::"
eexpect ":/# "
end_test

start_test "Check that --debug-sql-cli sets suitable simplified client-side options."
Expand Down

0 comments on commit 27c0a29

Please sign in to comment.