diff options
Diffstat (limited to 'tests/tui.exp')
| -rw-r--r-- | tests/tui.exp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/tui.exp b/tests/tui.exp new file mode 100644 index 0000000..4f79c31 --- /dev/null +++ b/tests/tui.exp @@ -0,0 +1,46 @@ +set timeout 12 +log_user 0 +log_file -a $env(QUOTA_LOG) +match_max 32000 +spawn -noecho $env(PANTO) -m antigravity:fast -r low +proc see {pattern} {expect { + -re $pattern {} + timeout {puts stderr "timeout awaiting $pattern: $expect_out(buffer)"; exit 1} + eof {puts stderr "early exit: $expect_out(buffer)"; exit 1} +}} +see {antigravity:} +foreach {prompt answer} {hello primary-tool-ok again same-session-ok} { + send -- $prompt; see $prompt; send -- "\r" + if {$prompt == "hello"} { + set reply 0; set quota 0 + while {!$reply || !$quota} { + expect { + -exact "primary-tool-ok" {set reply 1} + -exact "27%" {set quota 1} + timeout {puts stderr "first turn: reply=$reply quota=$quota"; exit 1} + eof {exit 1} + } + } + send -- "/reasoning high"; see {/reasoning high}; send -- "\r"; see {reasoning -> high} + } else {see $answer} +} +send -- "\003"; expect eof; wait +set flag [open "$env(HOME)/.local/share/panto-antigravity/google/usage-failure" w]; close $flag +spawn -noecho $env(PANTO) resume -m antigravity:fast -r high +see {antigravity:}; send -- "resume"; see {resume}; send -- "\r" +set reply 0; set quota 0 +while {!$reply || !$quota} { + expect { + -exact "resumed-ok" {set reply 1} + -exact "unavailable" {set quota 1} + timeout {puts stderr "resume: reply=$reply quota=$quota"; exit 1} + eof {exit 1} + } +} +send -- "\003"; expect eof; wait + +# xhigh exists before switching models, but not on gemini-test. +spawn -noecho $env(PANTO) --incognito -m antigravity:fast -r xhigh +see {antigravity:}; send -- "unsupported"; see {unsupported}; send -- "\r" +see {reasoning level xhigh} +send -- "\003"; expect eof; wait |
