summaryrefslogtreecommitdiff
path: root/test/snapshots/msg.snap
diff options
context:
space:
mode:
Diffstat (limited to 'test/snapshots/msg.snap')
-rw-r--r--test/snapshots/msg.snap77
1 files changed, 77 insertions, 0 deletions
diff --git a/test/snapshots/msg.snap b/test/snapshots/msg.snap
new file mode 100644
index 00000000..640e9a0c
--- /dev/null
+++ b/test/snapshots/msg.snap
@@ -0,0 +1,77 @@
+# The transient message row: the LAST row of a pane, left-aligned at the text
+# area's origin, saying what just happened to that pane and when. An OVERLAY,
+# not geometry — nothing shrinks to make room, so a pane with nothing to say is
+# not touched at all, which is why the other 71 goldens only moved where a
+# prompt or a message actually appears.
+#
+# The clock reads `--:--:--` here and only here: $PARDES_NOTIME (set by
+# snapshot.zig, the same flag that hides the language backend's durations)
+# blanks the DIGITS rather than the row, because a message that disappeared
+# under the harness could not be pinned at all.
+#
+# The row has exactly two possible occupants and they are not the same kind of
+# thing. A MESSAGE is a report of something that already happened, and the next
+# key or mouse event wipes it. An armed PROMPT is what that keystroke is being
+# typed INTO, it lives until Enter or Esc, and it WINS.
+lines a.txt 6
+start 14 70 a.txt
+wait 8000 New Newcol
+wait 8000 a.txt
+stable 700 20000
+snap opened
+# Save (SPC f s) writes the file; the SHELL is where the write and the clock
+# both are, so the shell is what posts the message once the bytes are down.
+key space f s
+stable 700 15000
+snap saved
+# A REPAINT is not input. A resize redraws every cell in the window from
+# scratch and the message is still there on the other side of it — the row is
+# state, not one frame's flash. (Different rows, or the kernel sends no
+# SIGWINCH and nothing repaints.)
+resize 16 70
+stable 700 15000
+snap repainted
+# ...but the next KEY takes it away. `j` is a plain cursor motion and changes
+# nothing else on screen, so the vanishing message is the whole diff.
+key j
+stable 700 15000
+snap keycleared
+# Again, and this time a bare mouse MOTION — no button, nothing clicked —
+# clears it: any mouse event counts, the rule is "you are back", not "you did
+# something".
+key space f s
+stable 700 15000
+snap saved-again
+motion 20 6
+stable 700 15000
+snap mousecleared
+# The other message: an external write lands in the pane (filewatch.snap owns
+# that contract) and the row says which of the two things happened. `run` is a
+# child of the RUNNER, so the app receives no keystroke here and nothing but
+# the watch could have posted this.
+run printf 'EXTERNAL\n' > a.txt
+wait 10000 EXTERNAL
+stable 700 15000
+snap reloaded
+# `/` still types into the tag tail — same buffer, same offsets, same one-line
+# editor, same Enter and Esc — but it is DRAWN here now, so the tagline keeps
+# its builtins instead of losing them to a long pattern. Note the tag row above
+# ends at `Del`: the marker and the pattern are no longer on it at all. (The
+# `/` keystroke also cleared the reload message, which is the rule above.)
+key /
+text EXT
+stable 700 15000
+snap prompt
+# ...and a message arriving UNDER an armed prompt does not disturb it: a second
+# external write reloads the pane and posts one, the row stays the prompt's.
+run printf 'AGAIN\n' > a.txt
+wait 10000 AGAIN
+stable 700 15000
+snap prompt-wins
+# Esc abandons the input, and the very key that abandoned it is also the key
+# that clears the message queued underneath — so the row goes empty rather than
+# handing back a report from before you started typing.
+key esc
+settle 100
+stable 700 15000
+snap esc