summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/selfmount.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/selfmount.py b/test/selfmount.py
index dd59083c..503ce1e0 100644
--- a/test/selfmount.py
+++ b/test/selfmount.py
@@ -186,6 +186,16 @@ def run(binary):
followed = recipe.read_text() if recipe.exists() else ''
recipe.unlink(missing_ok=True)
check(ran == '0' and 'recipe-heard' in followed, f'the log follow recipe with cat hears a new record ({followed[-120:]!r})')
+ # A bash read loop on a pane's event: bash reads it a piece at a
+ # time, and each record still arrives whole, in pieces.
+ looped = Path(f'/tmp/{name}.events')
+ ran = run((f"bash -c 'exec 3<{mount}/pane/{first}/event; "
+ f"(sleep 1; echo Msg ev-loop > {mount}/pane/{first}/exec) & "
+ f"read -r line <&3; echo \"$line\" > {looped}'\n").encode())
+ got_line = looped.read_text() if looped.exists() else ''
+ looped.unlink(missing_ok=True)
+ check(ran == '0' and got_line.startswith('FX') and got_line.rstrip().endswith('Msg ev-loop'),
+ f'a bash read loop on event reads a whole record ({got_line!r})')
client.write('/exec', b'Msg still here\n')
text = ''.join(cell[0] for cell in client.screen()['cells'])
check('still here' in text, 'the editor answers after all of that')