diff options
Diffstat (limited to 'test/selfmount.py')
| -rw-r--r-- | test/selfmount.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/selfmount.py b/test/selfmount.py index c8a81df9..347093e1 100644 --- a/test/selfmount.py +++ b/test/selfmount.py @@ -307,6 +307,13 @@ def run(binary): ran = run(f"echo 'Edit $ < cat {mount}/pane/{edited}/body' > {mount}/pane/{edited}/ctl\n".encode()) check(ran == '0' and client.read(f'/pane/{edited}/body') == b'apple\npear\napple\npear\n', f'an Edit whose command reads the session through its mount ({ran!r})') + # A filter gets what a pane's command gets: the session's mount, + # socket and pid. + env_pane = int(client.read('/pane/new')) + ran = run(f"echo 'Edit $ < printf \"%s|%s|%s\" \"$PARDES_MOUNT\" \"$PARDES_9P\" \"$PARDES_PID\"' > {mount}/pane/{env_pane}/ctl\n".encode()) + got_env = client.read(f'/pane/{env_pane}/body').decode().split('|') + check(ran == '0' and len(got_env) == 3 and got_env[0] == mount and got_env[1] == sock and got_env[2].isdigit(), + f'an Edit filter has $PARDES_MOUNT, $PARDES_9P and $PARDES_PID ({got_env!r})') # An interrupted Edit write is flushed: its command is stopped and # nothing changes, and the next Edit runs. flushed = Path(f'/tmp/{name}.flushed') |
