summaryrefslogtreecommitdiff
path: root/tests/tui.exp
blob: 4f79c31e5dd523711e485c0713a955c9c1c261f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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