diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-15 17:06:27 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-09-15 17:24:42 -0300 |
| commit | 6560da36cf8111575cd3fec443a42de6eff82f5f (patch) | |
| tree | 5c977f487c705b4e801de840b9a7720ad8b7b18f /test/tag_cleanup.py | |
| parent | 9ce11bfeff73b96704e521b41cffe4625b02f103 (diff) | |
| download | pardes-6560da36cf8111575cd3fec443a42de6eff82f5f.tar.gz pardes-6560da36cf8111575cd3fec443a42de6eff82f5f.zip | |
Cycle pane input modes with Mode and retain terminal tag access
Diffstat (limited to 'test/tag_cleanup.py')
| -rw-r--r-- | test/tag_cleanup.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/test/tag_cleanup.py b/test/tag_cleanup.py index 81b15ad8..52ee8e9d 100644 --- a/test/tag_cleanup.py +++ b/test/tag_cleanup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Check compact PDF tags and Togglettymode/Ctrl-B parity in an isolated 9P session.""" +"""Check compact PDF tags and Mode cycling and Ctrl-B in an isolated 9P session.""" import argparse from pathlib import Path @@ -42,27 +42,34 @@ def run(args): frame = client.screen() for row in range(frame['rows']): text = ''.join(c[0] for c in frame['cells'][row * frame['cols']:(row + 1) * frame['cols']]) - if ' Togglettymode Filter' in text: - return text.index(' Togglettymode Filter') + 1, row, text[0] + if ' Mode Filter' in text: + return text.index(' Mode Filter') + 1, row, text[0] return None require(wait_for(lambda: (p := tag_position()) and p[2] == '$'), 'new terminal not in raw mode') x, y, _ = tag_position() keys.click(x, y, button=1) - require(wait_for(lambda: (p := tag_position()) and p[2] == ' '), 'Togglettymode click did not enter normal mode') + require(wait_for(lambda: (p := tag_position()) and p[2] == ' '), 'Mode click did not enter normal mode') + for badge in ('^', '$'): + x, y, _ = tag_position() + keys.click(x, y, button=1) + require(wait_for(lambda: (p := tag_position()) and p[2] == badge), 'Mode cycle did not reach ' + badge) + x, y, _ = tag_position() + keys.click(x, y, button=1) + require(wait_for(lambda: (p := tag_position()) and p[2] == ' '), 'Mode did not return to normal') keys.send(b'\x02') require(wait_for(lambda: (p := tag_position()) and p[2] == '$'), 'Ctrl-B did not restore raw mode') x, y, _ = tag_position() keys.click(x, y) keys.send(b'\t') - require(wait_for(lambda: (p := tag_position()) and p[2] == ' '), 'Togglettymode from edited tag ignored parked raw mode') + require(wait_for(lambda: (p := tag_position()) and p[2] == ' '), 'Mode from edited tag ignored parked raw mode') keys.send(b'\x02') - client.write(f'/self/pane/{tty}/pty/data', b"printf 'Togglettymode toggle ready\\n'\r") - require(wait_for(lambda: b'Togglettymode toggle ready' in client.read(f'/self/pane/{tty}/body')), 'terminal input failed') + client.write(f'/self/pane/{tty}/pty/data', b"printf 'Mode toggle ready\\n'\r") + require(wait_for(lambda: b'Mode toggle ready' in client.read(f'/self/pane/{tty}/body')), 'terminal input failed') capture(client, root, 'pdf-and-tty-tags', not args.tty) require(source.read_bytes() == original, 'PDF file changed') client.write(f'/self/pane/{tty}/pty/data', b'exit\r') - print('PDF tag, Togglettymode click, Ctrl-B, edited-tag execution and source preservation passed') + print('PDF tag, Mode click, Ctrl-B, edited-tag execution and source preservation passed') if __name__ == '__main__': |
