summaryrefslogtreecommitdiff
path: root/test/snapshots
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-25 02:07:23 -0300
committerGabriel Schneider <[email protected]>2026-08-25 09:42:07 -0300
commit6f48508aa08396bcf9dd4da2cab1d221bcc53f78 (patch)
tree83daec3db5ac27ea3172651df2b3e9cb62eddb4a /test/snapshots
parent28c70cabb6ceb7e5fecfd74f6984f5a995269f01 (diff)
downloadpardes-6f48508aa08396bcf9dd4da2cab1d221bcc53f78.tar.gz
pardes-6f48508aa08396bcf9dd4da2cab1d221bcc53f78.zip
acmefs: pardes --fs serves acme's control filesystem over raw Linux FUSE
Diffstat (limited to 'test/snapshots')
-rw-r--r--test/snapshots/acmefs-event.golden66
-rw-r--r--test/snapshots/acmefs-event.snap39
-rw-r--r--test/snapshots/acmefs.golden81
-rw-r--r--test/snapshots/acmefs.snap40
4 files changed, 226 insertions, 0 deletions
diff --git a/test/snapshots/acmefs-event.golden b/test/snapshots/acmefs-event.golden
new file mode 100644
index 00000000..01c493da
--- /dev/null
+++ b/test/snapshots/acmefs-event.golden
@@ -0,0 +1,66 @@
+== snap after-suppressed-click grid=100x30 cursor=7,5
+|New Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill
+|$ /tmp/pardes-snap/acmefs-event/cwd Save New Newtty Del Filter
+| $
+| /tmp/pardes-snap/acmefs-event/cwd/+New * Save New Newtty Del
+| 1 Newcol
+| 2
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== file events
+MX0 6 1 6 Newcol|
+
+== end file
+== snap after-unsuppressed-click grid=100x30 cursor=57,2
+|New Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill
+|$ /tmp/pardes-snap/acmefs-event/cwd Save New Newtt /tmp/pardes-snap/acmefs-event/cwd/+New Save New
+| $ 1
+| /tmp/pardes-snap/acmefs-event/cwd/+New * Save Ne
+| 1 Newcol
+| 2
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
diff --git a/test/snapshots/acmefs-event.snap b/test/snapshots/acmefs-event.snap
new file mode 100644
index 00000000..33f8b01c
--- /dev/null
+++ b/test/snapshots/acmefs-event.snap
@@ -0,0 +1,39 @@
+# The acme INVERSION, end to end: while a script holds a pane's `event` file
+# open, a middle click in that pane is REPORTED to the script instead of being
+# executed by the editor. That is how an acme client defines its own commands —
+# `Step`, `Run`, `Clear` in examples/acmefs/life.py — and it is the one piece of
+# this filesystem that changes what a click MEANS.
+#
+# The clicked word is `Newcol`, a real pardes builtin, so the two halves of the
+# test cannot be confused with each other: with a reader attached the screen
+# must not change and the record must arrive; with the reader gone the same
+# click must open a column. It sits on the +New pane's first body line — row 5,
+# and the line-number gutter is 7 cells wide, so the word starts at column 8.
+run sh -c 'fusermount3 -u -z /tmp/pardes-acmefs-ev 2>/dev/null; rm -rf /tmp/pardes-acmefs-ev; exit 0'
+start 30 100 --fs=/tmp/pardes-acmefs-ev
+wait 8000 New Newcol
+stable 700 20000
+run sh -c 'M=/tmp/pardes-acmefs-ev; id=$(cut -c1-11 < $M/new/ctl | tr -d " "); echo $id > id.txt; printf "Newcol\n" >> $M/$id/body'
+wait 8000 New Newcol
+stable 700 15000
+# a reader arrives: from here on, buttons 2 and 3 in this pane are its business
+run sh -c 'M=/tmp/pardes-acmefs-ev; id=$(cat id.txt); (cat $M/$id/event > events.txt & echo $! > cat.pid); sleep 1'
+press middle 9 5
+release middle 9 5
+stable 700 15000
+# The screen must be UNCHANGED: no column opened, because the click belonged to
+# the reader. An editor that had performed it would have split the layout.
+snap after-suppressed-click
+# The reader's death is asynchronous: the kernel sends RELEASE when the process
+# closes, and pardes drains filesystem requests in its frame poll, AFTER input.
+# A click delivered in the same wakeup as that RELEASE is therefore still the
+# reader's. One second of sleep is more than the frame this takes.
+run sh -c 'sleep 1; kill $(cat cat.pid) 2>/dev/null; sleep 1; sed -e "s/$/|/" events.txt > ev.txt; exit 0'
+snapfile events ev.txt
+# ...and with the reader gone, the same click is an ordinary Exec again: this
+# one opens the column.
+press middle 9 5
+release middle 9 5
+stable 700 15000
+snap after-unsuppressed-click
+run sh -c 'fusermount3 -u -z /tmp/pardes-acmefs-ev 2>/dev/null; rm -rf /tmp/pardes-acmefs-ev; exit 0'
diff --git a/test/snapshots/acmefs.golden b/test/snapshots/acmefs.golden
new file mode 100644
index 00000000..179ecba8
--- /dev/null
+++ b/test/snapshots/acmefs.golden
@@ -0,0 +1,81 @@
+== file tree
+1
+cons
+index
+new
+
+== end file
+== snap fs-body-written grid=100x30 cursor=7,5
+|New Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill
+|$ /tmp/pardes-snap/acmefs/cwd Save New Newtty Del Filter
+| $
+| /tmp/pardes-snap/acmefs/cwd/+New * Save New Newtty Del
+| 1 hello from outside
+| 2
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+== file body
+hello from outside
+
+== end file
+== file ctlid
+2
+
+== end file
+== file firstid
+1
+
+== end file
+== snap fs-event-exec grid=100x30 cursor=57,2
+|New Newcol Joincol Find Grep Help Changelog Tutor Dump NextColor Debug Kill
+|$ /tmp/pardes-snap/acmefs/cwd Save New Newtty Del /tmp/pardes-snap/acmefs/cwd/+New Save New Newtty
+| $ 1
+| /tmp/pardes-snap/acmefs/cwd/+New *
+| 1 hello from outside
+| 2
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
+|
diff --git a/test/snapshots/acmefs.snap b/test/snapshots/acmefs.snap
new file mode 100644
index 00000000..e338245b
--- /dev/null
+++ b/test/snapshots/acmefs.snap
@@ -0,0 +1,40 @@
+# acme's control filesystem, end to end: a process OUTSIDE pardes opens a pane,
+# fills its body, reads it back through the same tree, and finally drives a
+# builtin by writing an event record — the acme remote-control door.
+#
+# Everything here runs through a real FUSE mount served by the real binary, so
+# a failure means the mount, the protocol, the transaction or the semantics —
+# there is nothing else in the path.
+#
+# The mount lives OUTSIDE this script's own directory, and the script unmounts
+# it at both ends. Two reasons, both about how this harness works: it kills the
+# app with SIGKILL, so pardes never gets to unmount (that is what
+# fuse.sweepStale exists for, but a `--fs=<dir>` this explicit is not ours to
+# sweep), and a stale ENOTCONN mount inside the per-script directory would make
+# the next run's `rm -rf` — and therefore its mkdir — fail.
+run sh -c 'fusermount3 -u -z /tmp/pardes-acmefs-snap 2>/dev/null; rm -rf /tmp/pardes-acmefs-snap; exit 0'
+start 30 100 --fs=/tmp/pardes-acmefs-snap
+wait 8000 New Newcol
+stable 700 20000
+# the tree acme(4) describes, served by pardes
+run sh -c 'ls /tmp/pardes-acmefs-snap > tree.txt 2>&1'
+snapfile tree tree.txt
+# `new` creates a pane on ACCESS, and its ctl reads back the pane's own id
+# (field 1 of acme's five). Writing body appends, so the pane holds the bytes.
+run sh -c 'M=/tmp/pardes-acmefs-snap; id=$(cut -c1-11 < $M/new/ctl | tr -d " "); echo $id > id.txt; printf "hello from outside\n" >> $M/$id/body'
+wait 8000 hello from outside
+stable 700 15000
+snap fs-body-written
+# ...and reading it back is the same filesystem answering about live state
+run sh -c 'M=/tmp/pardes-acmefs-snap; id=$(cat id.txt); cat $M/$id/body > body.txt; cut -c1-11 < $M/$id/ctl | tr -d " " > ctlid.txt; sed -n 1p $M/index | cut -c1-11 | tr -d " " > firstid.txt'
+snapfile body body.txt
+snapfile ctlid ctlid.txt
+snapfile firstid firstid.txt
+# THE DOOR: put a builtin in the pane's tag, then write an event record naming
+# its byte range. pardes executes it exactly as a middle click would — which is
+# how an acme client has always run editor commands, and is code execution by
+# design (see examples/README.md).
+run sh -c 'M=/tmp/pardes-acmefs-snap; id=$(cat id.txt); q0=$(wc -c < $M/$id/tag); printf " Newcol" >> $M/$id/tag; q1=$(wc -c < $M/$id/tag); printf "Mx%d %d\n" $((q0 + 1)) $q1 > $M/$id/event'
+stable 700 15000
+snap fs-event-exec
+run sh -c 'fusermount3 -u -z /tmp/pardes-acmefs-snap 2>/dev/null; rm -rf /tmp/pardes-acmefs-snap; exit 0'