aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/ux-check.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/ux-check.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/ux-check.sh b/scripts/ux-check.sh
index 019f63d..204fc98 100755
--- a/scripts/ux-check.sh
+++ b/scripts/ux-check.sh
@@ -78,6 +78,30 @@ if echo "$screen" | grep -q 'line two.*Hello from the mock'; then
78 fail_msg "the answer was written on the same line as the prompt" 78 fail_msg "the answer was written on the same line as the prompt"
79fi 79fi
80 80
81# Resizing while typing must not duplicate the prompt or erase what is above it.
82printf 'ZEBRA alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu' \
83 | tmux load-buffer -b uxresize -
84tmux paste-buffer -p -b uxresize -t "$session"
85sleep 0.5
86tmux resize-window -t "$session" -x 40 -y 24
87sleep 0.6
88screen=$(tmux capture-pane -p -t "$session")
89[ "$(echo "$screen" | grep -c ZEBRA)" -eq 1 ] \
90 || fail_msg "resizing to 40 columns duplicated the prompt"
91echo "$screen" | grep -q "Hello from the mock provider" \
92 || fail_msg "resizing erased the output above the prompt"
93
94# Typing after the resize must redraw in the right place.
95tmux send-keys -t "$session" End
96sleep 0.3
97tmux send-keys -t "$session" -l "!"
98sleep 0.4
99screen=$(tmux capture-pane -p -t "$session")
100[ "$(echo "$screen" | grep -c ZEBRA)" -eq 1 ] \
101 || fail_msg "redrawing after a resize duplicated the prompt"
102echo "$screen" | grep -q "Hello from the mock provider" \
103 || fail_msg "redrawing after a resize erased output above"
104
81if [ "$fail" -ne 0 ]; then 105if [ "$fail" -ne 0 ]; then
82 echo "--- final screen ---" >&2 106 echo "--- final screen ---" >&2
83 echo "$screen" >&2 107 echo "$screen" >&2