summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 04:58:25 -0300
committerGabriel Schneider <[email protected]>2026-10-01 04:58:26 -0300
commit36fe45e3a4a7ce9b61ab7bf2df07f0132a9170c1 (patch)
tree7c2dd36427e170e05b880666b2c8f5f3d4f108d5 /test
parent0c3cf0628adf9e22270b09d9c451b08ac07f558a (diff)
downloadpardes-36fe45e3a4a7ce9b61ab7bf2df07f0132a9170c1.tar.gz
pardes-36fe45e3a4a7ce9b61ab7bf2df07f0132a9170c1.zip
`--` ends pardes's options: `pardes -- -dash.txt` opens the file named -dash.txt
It said `no such option: --`. What follows `--` is a name, one at most, as for any other positional. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/fs.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/fs.py b/test/fs.py
index f24e2550..6c6bcbef 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -989,6 +989,7 @@ def test(binary, quic=False):
for options, message in [
(['--fs'], b'no such option'),
(['--fs9'], b'no such option'),
+ (['--', 'a', 'b'], b'is the second'),
(['--9p'], b'--9p needs a socket name'),
(['--9p='], b'invalid 9P socket name'),
(['--9p=a/b'], b'invalid 9P socket name'),
@@ -1396,6 +1397,14 @@ def test(binary, quic=False):
assert time.monotonic() - deleted < .05, time.monotonic() - deleted
assert second.wait(timeout=5) == 0
assert edited.read_bytes() == b'edited\n'
+ # `--` ends the options: a name starting with a dash is a name.
+ dash = root / '-dash.txt'
+ dash.write_bytes(b'dash\n')
+ before = serials()
+ assert subprocess.run([binary, '--', dash.name], cwd=root, env=env, capture_output=True, timeout=10).returncode == 0
+ dashed, = serials() - before
+ assert client.read(f'/pane/{dashed}/name').rstrip(b'\n') == str(dash).encode()
+ client.remove(f'/pane/{dashed}')
# --wait waits on the pane its look answered, on the look's own
# open: a name /index shows escaped (a backslash is `\\` there)
# is still the pane waited on, not one already gone.