summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fs.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/fs.py b/test/fs.py
index 10802e19..a1e2ae79 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -436,9 +436,14 @@ def run_file(binary):
assert run(client, term, b'fi\n') == b'error not run\n' # a syntax error runs nothing
assert run(client, term, b"echo 'open\n") == b'error not run\n' # nor does an open quote
assert run(client, term, b'true\n') == b'exit 0\n' # ...and the shell is clear after
- # A pty asked for one row gets two: one loses the prompt's input
- # mark, and the shell would read busy for ever.
- client.write(f'/pane/{term}/pty/ctl', b'winsize 20 1\n')
+ # A pty is not given one row (it loses the prompt's input mark,
+ # and the shell would read busy for ever): refused, and said.
+ try:
+ client.write(f'/pane/{term}/pty/ctl', b'winsize 20 1\n')
+ raise AssertionError('winsize 20 1 was taken')
+ except OSError as refused:
+ assert 'at least 2 rows' in str(refused), refused
+ client.write(f'/pane/{term}/pty/ctl', b'winsize 20 2\n')
time.sleep(.5)
assert run(client, term, b'true\n') == b'exit 0\n'
assert client.read(f'/pane/{term}/pty/ctl').split()[2] == b'2', client.read(f'/pane/{term}/pty/ctl')