diff --git a/tests/test_terminal.py b/tests/test_terminal.py index 4889f8d..7eac2a4 100644 --- a/tests/test_terminal.py +++ b/tests/test_terminal.py @@ -701,6 +701,14 @@ def test_terminal_strip_instructions(terminal): text = ''.format(TOKEN) assert terminal.strip_instructions(text) == '' + # Whitespace at the start of the first line should be preserved + text = ' code\n block\n' + assert terminal.strip_instructions(text) == ' code\n block' + + # But blank lines should be stripped + text = '\n \n code\n block\n' + assert terminal.strip_instructions(text) == ' code\n block' + def test_terminal_get_link_pages(terminal):