aboutsummaryrefslogtreecommitdiff
path: root/tests/pi-live.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pi-live.sh')
-rwxr-xr-xtests/pi-live.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/pi-live.sh b/tests/pi-live.sh
index 6083be4..8e01e74 100755
--- a/tests/pi-live.sh
+++ b/tests/pi-live.sh
@@ -249,6 +249,10 @@ expect "context: known again after a reply" "ctx | grep -cE '^[0-9]+$'" 1 30
expect "context: pi's number again" same_as_footer same 30
expect "the menu: the percentage last" "\"$MENU\" --print | grep -F 'main · ctx' | cut -f3 | grep -oE ' [0-9]+%$'" " $(ctx)%"
expect "the panel: cost, then context" "\"$MENU\" --print-panel --full | grep -F 'main · ctx' | cut -f4 | grep -oE '^\\\$[0-9.]+ [0-9]+%$' | grep -c ' $(ctx)%'" 1
+# Its cost, compaction included, as pi's footer counts it ("$16.000").
+footer_cost() { t capture-pane -p -t main:ctx | grep -E '/400' | grep -oE '\$[0-9.]+' | tail -1 | tr -d '$'; }
+same_cost() { python3 -c "import sys; a,b=sys.argv[1:]; print('same' if a and b and abs(float(a)-float(b))<0.005 else f'dingger [{a}] footer [{b}]')" "$(t show -pv -t main:ctx @dingger_cost 2>/dev/null)" "$(footer_cost)"; }
+expect "cost: compaction counted, as pi's footer counts" same_cost same 30
t kill-window -t main:ctx
echo "2. screen detection (pi without the extension)"