summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fs.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/fs.py b/test/fs.py
index c7552a2b..ca1ca70e 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -338,6 +338,14 @@ def discovery(binary, embedded=False):
assert client.read('/src/pardes.zig').startswith(b'const std')
assert client.stat('/src/pardes.zig')['mode'] == 0o444
assert b'pub const Pardes' in client.read(f'/pane/{look(client, "/virtual/src/pardes.zig")}/body')
+ # An open of data with OTRUNC (a shell's >) deletes the addressed
+ # range only, so the write after it replaces that range.
+ scratch = new_pane(client, b'hello world\nsecond line\n')
+ 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'
+ 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')