summaryrefslogtreecommitdiff
path: root/test/fs.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs.py')
-rw-r--r--test/fs.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/fs.py b/test/fs.py
index 8eed2e29..33abb835 100644
--- a/test/fs.py
+++ b/test/fs.py
@@ -1529,6 +1529,26 @@ def test(binary, quic=False):
log_now = client.read('/log').decode()
assert f'\nnew {made_now} {root}/+Pager\n' in '\n' + log_now, log_now[-400:]
assert f'\nrename {made_now} ' not in '\n' + log_now
+ # Its colours are the pane's, drawn and never read: the body is
+ # the plain text, and the screen shows `red` in the theme's red
+ # and `rgb` in the colour given, the rest in the pane's ink.
+ fed = subprocess.run([binary, '-'], cwd=root, env=env,
+ input=b'\x1b]0;title\x07\x1b[31mred\x1b[m \x1b[38;2;1;2;3mrgb\x1b[m plain\n',
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=10)
+ assert fed.returncode == 0, fed.stderr
+ assert client.read(f'/pane/{made_now}/body') == b'red rgb plain\n'
+ screen = client.screen()
+ for row in range(screen['rows']):
+ cells = screen['cells'][row * screen['cols']:(row + 1) * screen['cols']]
+ text = ''.join(cell[0] for cell in cells)
+ at = text.find('red rgb plain')
+ if at >= 0:
+ break
+ else:
+ raise AssertionError(('the paged text is not on the screen', screen))
+ ink = [screen['styles'][cells[at + i][1]]['fg'] for i in (0, 4, 8)]
+ assert ink[1] == {'rgb': [1, 2, 3]}, ink
+ assert ink[0] != ink[2] and ink[0] != ink[1], ink
# The directory's one +Pager: the next paged text refills it.
fed = subprocess.run([binary, '-'], cwd=root, env=env, input=b'again\r\nprogress 10%\rprogress 100%\n',
stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=10)