diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-07 04:48:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-07 04:48:35 +0000 |
commit | 207df6fc406e81bfeebdff7f404bd242ff3f099f (patch) | |
tree | a1a796b056909dd0a04ffec163db9363a8757808 /test/naughty_files.py | |
parent | Releasing progress-linux version 0.11.2-1~progress7.99u1. (diff) | |
download | lnav-207df6fc406e81bfeebdff7f404bd242ff3f099f.tar.xz lnav-207df6fc406e81bfeebdff7f404bd242ff3f099f.zip |
Merging upstream version 0.12.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/naughty_files.py')
-rwxr-xr-x | test/naughty_files.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/naughty_files.py b/test/naughty_files.py new file mode 100755 index 0000000..0b8e5c1 --- /dev/null +++ b/test/naughty_files.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +import os + +os.makedirs("naughty", 0o700, True) +with open('naughty/file-with-escape-sequences-\x1b[31mred\x1b[m-color.txt', 'w+') as fi: + fi.write('boo') + +with open('naughty/file-with-escape-sequences-\x1b[31mred\x1b[m-color.log', 'w+') as fi: + fi.write('2012-07-02 10:22:40,672:DEBUG:foo bar baz\n') + +try: + with open(b'naughty/text-file-with-invalid-utf-\xc3\x28', 'w+') as fi: + fi.write('boo') + + with open(b'naughty/log-file-with-invalid-utf-\xc3\x28', 'w+') as fi: + fi.write('2015-04-24T21:09:39.296 25376]ERROR:somemodule:Something very INFOrmative.') +except OSError as e: + pass + +with open('naughty/file-with-hidden-text.txt', 'w+') as fi: + fi.write('Hello, \x1b[30;40mWorld!\x1b[m!\n') + fi.write('Goodbye, \x1b[37;47mWorld!\x1b[m!\n') + fi.write('That is not\b\b\ball\n') + +with open('naughty/file-with-terminal-controls.txt', 'w+') as fi: + fi.write('time for a reset \x1bckapow\n') + fi.write('ding dong! \x07\n') |