summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 21:25:38 -0300
committerGabriel Schneider <[email protected]>2026-10-01 21:55:57 -0300
commit97efe2d711b8b357157db2cb3402c3488064117a (patch)
tree4f3b403578a7116cdc75f60200e85c1410df0dbb /test
parent778de441bc5645bf15ba8d3dff83766fbb70499e (diff)
downloadpardes-97efe2d711b8b357157db2cb3402c3488064117a.tar.gz
pardes-97efe2d711b8b357157db2cb3402c3488064117a.zip
A refused Putall is answered once the other saves have landed; a bad Tab width is invalid (EINVAL), from a pane's exec too; Incl refuses a relative or missing directory and takes - only alone
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/fs.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/fs.py b/test/fs.py
index 1303db0d..59668c57 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -627,6 +627,34 @@ def directory_panes(binary):
assert client.read(f'/pane/{serial}/body').decode().split() == ['.dot', 'later', 'sub/']
+def putall_answers_after_its_saves(binary):
+ """Putall with one pane refused (its file changed on disk under unsaved
+ edits) fails, and is answered only once the other panes' saves have
+ landed."""
+ with tempfile.TemporaryDirectory(prefix='pardes-putall-') as directory:
+ root = Path(directory).resolve()
+ (root / 'a.txt').write_bytes(b'a\n')
+ (root / 'b.txt').write_bytes(b'b\n')
+ with session(binary, root, 'putall') as (client, _):
+ a = look(client, str(root / 'a.txt'))
+ b = look(client, str(root / 'b.txt'))
+ for serial in (a, b):
+ client.write(f'/pane/{serial}/body', b'edited\n')
+ (root / 'b.txt').write_bytes(b'changed on disk\n')
+ deadline = time.monotonic() + 10
+ while f'changed {b}' not in client.read('/log').decode():
+ assert time.monotonic() < deadline, 'the watch never saw b.txt change'
+ time.sleep(.05)
+ try:
+ client.write('/ctl', b'Putall\n')
+ except OSError as why:
+ assert 'modified on disk' in str(why), why
+ else:
+ raise AssertionError('Putall over a file changed on disk was taken')
+ assert (root / 'a.txt').read_bytes() == b'a\nedited\n', (root / 'a.txt').read_bytes()
+ assert (root / 'b.txt').read_bytes() == b'changed on disk\n'
+
+
def new_terminals_named_once(binary):
"""A terminal started outside the session's directory is named by that
directory from its `new` on: no rename to the session's and back."""
@@ -1077,6 +1105,7 @@ def test(binary, quic=False):
unattended_messages_expire(binary)
new_terminals_named_once(binary)
directory_panes(binary)
+ putall_answers_after_its_saves(binary)
workflow_canary(binary)
recent_survives_restart(binary)
python_repl_runs_one_line(binary)