summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fs.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/fs.py b/test/fs.py
index ca1ca70e..a6d24e0b 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -344,6 +344,18 @@ def discovery(binary, embedded=False):
client.write(f'/pane/{scratch}/addr', b'#0,#5')
client.write(f'/pane/{scratch}/data', b'HOWDY', truncate=True)
assert client.read(f'/pane/{scratch}/body') == b'HOWDY world\nsecond line\n'
+ # sam's regexps: ^ at any line; a miss says so and leaves no
+ # address, so the data write after it refuses.
+ client.write(f'/pane/{scratch}/addr', b'/^second/')
+ assert client.read(f'/pane/{scratch}/addr') == b' 12 18 '
+ for path, data, why in ((f'/pane/{scratch}/addr', b'/nowhere/', 'no match for regexp'),
+ (f'/pane/{scratch}/data', b'LOST', 'no address')):
+ try:
+ client.write(path, data)
+ raise AssertionError(f'{path} took {data!r}')
+ except OSError as refused:
+ assert why in str(refused), refused
+ assert client.read(f'/pane/{scratch}/body') == b'HOWDY world\nsecond line\n'
client.remove(f'/pane/{scratch}')
print('9P discovery: listing/stat/find are inert; new, remove, look, exec, name, sel, log, ctl lock, focus, the ctl split and commands behave')