summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fs.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/fs.py b/test/fs.py
index 97af9e6b..841dd32a 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -715,10 +715,13 @@ def recent_survives_restart(binary):
with session(binary, root, 'recent2') as (client, _):
listed = client.read('/recent').decode()
assert f'closed {kept}\n' in listed, listed
- # Recent shows it, and a look at its row opens it again.
+ # Recent fills a query pane with it, its row relative to the
+ # pane's directory, and a look at the row opens it again.
client.write('/pane/1/exec', b'Recent\n')
rows = int(client.read('/pane/1/exec').split()[-1])
- row = next(r for r in client.read(f'/pane/{rows}/body').decode().splitlines() if r.startswith(f'{kept}:'))
+ body = client.read(f'/pane/{rows}/body').decode()
+ assert body.startswith('Recent '), body
+ row = next(r for r in body.splitlines() if r.startswith('kept.txt:'))
client.write(f'/pane/{rows}/look', (row.split(' ')[0] + '\n').encode())
assert f'open {kept}\n' in client.read('/recent').decode()
@@ -759,11 +762,11 @@ def workflow_canary(binary):
assert client.read(f'/pane/{a}/body') == b'alpha one\nshared word\n'
assert f'new {a} {root}/a.txt\n' in log() and f'new {b} {root}/b.txt\n' in log()
- # Grep and Find: a hit opens its +Search, rows and all; a miss
- # fails ENOENT, opening nothing.
+ # Grep and Find: a hit fills its query pane, line 1 the query and
+ # the lines under each file's name; a miss fails ENOENT.
grep = made_by(a, b'Grep shared\n')
rows = client.read(f'/pane/{grep}/body').decode()
- assert 'a.txt:2' in rows and 'b.txt:2' in rows, rows
+ assert rows == 'Grep shared\na.txt\n 2 shared word\nb.txt\n 2 shared word\n', rows
client.remove(f'/pane/{grep}')
execute_refused(client, a, 'Grep zzqqnomatch', 'Grep: text not found')
found = made_by(a, b'Find b.txt\n')