summaryrefslogtreecommitdiff
path: root/tests/tui.exp
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-11-27 08:46:14 -0700
committert <t@tjp.lol>2026-11-30 08:34:38 -0700
commit47039f21a170e29875a2676f7a2eb5a779144b74 (patch)
tree495ffa7dab8de455a8d2ebfafd45dfcce5da52b7 /tests/tui.exp
Add Antigravity ACP provider for Panto
Diffstat (limited to 'tests/tui.exp')
-rw-r--r--tests/tui.exp46
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