summaryrefslogtreecommitdiff
path: root/test/monkey9p.py
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 16:51:34 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit6122159572f1cc950666df484e2074cf32f22eb5 (patch)
tree62e0d2f960af827826e1b615777cab9a243f506d /test/monkey9p.py
parenta15eabc3b9d98ef5f659ca82a2b0f2afb7451a39 (diff)
downloadpardes-6122159572f1cc950666df484e2074cf32f22eb5.tar.gz
pardes-6122159572f1cc950666df484e2074cf32f22eb5.zip
A 9P look keeps its leading blanks: an indented line, or blanks alone, is looked for as written
Every line written to look or exec went through Messages.next, which trimmed blanks from both ends. A look of ` indented` then found the first bare `indented`, and a diff's blank context line ` ` looked at nothing. A look's line is now its text: only its `\r` and newline go. lookAt keeps the blanks for the word search too; it expands `~` only for a look that starts with one, and the path, address and command readings trim for themselves as before. runSearch keeps a pattern's blanks, since a builtin's argument comes trimmed already. An exec line is trimmed as before. fs.md says so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/monkey9p.py')
-rw-r--r--test/monkey9p.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/monkey9p.py b/test/monkey9p.py
index 89751145..64b82832 100644
--- a/test/monkey9p.py
+++ b/test/monkey9p.py
@@ -698,8 +698,13 @@ def allowances(res, path, data, sizes, room):
(acme's xfid.c:842) or run as the Look builtin; an Edit block whose text
never ended runs, and fails, at the close."""
base = path.rsplit('/', 1)[-1]
- lines = [line for line in served_lines(data, sizes, room) if line.strip()]
- if base in ('look', 'event'):
+ served = served_lines(data, sizes, room)
+ lines = [line for line in served if line.strip()]
+ if base == 'look':
+ # A look's line is its text, blanks and all: one of blanks alone
+ # is a look too (fs.md); only an empty one (or a lone \r) is none.
+ n = len([line for line in served if line.rstrip(b'\r')])
+ elif base == 'event':
n = len(lines)
elif base in ('exec', 'ctl', 'tagexec'):
n = sum(1 for line in lines if line.split()[:1] == [b'Look'])