diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-09 06:54:27 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-10 09:17:07 -0300 |
| commit | 599dd82f96b9d091aae78300aa6c3fbc81f9eb69 (patch) | |
| tree | 532d29eb0d79896cd730fb324df4866056306506 /test/snapshots/nested-optout.snap | |
| parent | 628aa40f13e9bbd313b51ab625f193110aad8dd0 (diff) | |
| download | pardes-599dd82f96b9d091aae78300aa6c3fbc81f9eb69.tar.gz pardes-599dd82f96b9d091aae78300aa6c3fbc81f9eb69.zip | |
review pass: fix the eaten Tab, drop the duplicated code, cover the gaps
Diffstat (limited to 'test/snapshots/nested-optout.snap')
| -rw-r--r-- | test/snapshots/nested-optout.snap | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test/snapshots/nested-optout.snap b/test/snapshots/nested-optout.snap new file mode 100644 index 00000000..27e1ba3d --- /dev/null +++ b/test/snapshots/nested-optout.snap @@ -0,0 +1,52 @@ +# `--nested` is the documented escape hatch out of the hand-the-file-outward +# mechanism, and nested.snap covers only the mechanism. The flag says two +# things at once and both are asserted here: an instance carrying it keeps its +# own argument instead of forwarding it, AND it is not an outer instance for +# anything launched inside IT (tty.zig binds no socket when opts.nested). +# +# The same trick nested.snap uses to get a genuine descendant: a pane shell's +# parent IS the app under test, so `$(readlink /proc/$PPID/exe)` in a pane is +# this exact binary. What discriminates is the GRID — a second topbar drawn +# INSIDE the pane, with the outer instance still one shell wide. +# +# Long waits on purpose: each arm forks and execs whole further pardes. +file nested.txt optout-marker\nsecond-optout-line\n +dirmk innerdir +file innerdir/deeper.txt deepest-marker\n +# --- a file argument, WITH the flag: the inner keeps it --- +# Without --nested this is nested.snap's first arm and the outer grows a +# file pane beside the shell. Here the outer's layout never changes: one +# shell, and a whole second pardes drawn inside it holding nested.txt. +start 30 100 +wait 8000 $ +stable 700 20000 +text $(readlink /proc/$PPID/exe) --nested nested.txt +key enter +wait 20000 optout-marker +stable 700 20000 +snap optout-file +# --- ...and it is not an outer instance either --- +# The subshell is what makes the wait unambiguous: the inner boots in +# `innerdir` while the outer pane's own shell stays in cwd, so `cwd/innerdir` +# on the grid can only be the inner instance's tagline. --nested with no +# argument is still a bare launch, so the inner comes up in tty mode and +# keystrokes travel through both layers to its shell. +start 30 100 +wait 8000 $ +stable 700 20000 +text (cd innerdir && $(readlink /proc/$PPID/exe) --nested) +key enter +wait 20000 cwd/innerdir +stable 700 20000 +snap inner-shell +# A third pardes, launched from inside the inner one. Its nearest pardes +# ancestor is the INNER instance, which bound no socket, so the send fails and +# it opens its own session where it stands — three topbars. The assertion is +# the row it did NOT appear on: the outer instance is still one shell pane, and +# a walk that had skipped past the opted-out instance would have put +# deeper.txt up there beside it. +text $(readlink /proc/$PPID/exe) deeper.txt +key enter +wait 20000 deepest-marker +stable 700 20000 +snap inner-launch |
