aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/py/lib/test_repo.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-10 02:42:53 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-10 02:42:53 +0200
commita2cfab583c8739356fd7e6c0f822e8f247e61b87 (patch)
treef46a714aeb1f29af5189304615e89a78a404ad40 /test/py/lib/test_repo.py
parentstring: add a comment (diff)
downloadcimple-a2cfab583c8739356fd7e6c0f822e8f247e61b87.tar.gz
cimple-a2cfab583c8739356fd7e6c0f822e8f247e61b87.zip
test: test CI run output containing \0
Diffstat (limited to '')
-rw-r--r--test/py/lib/test_repo.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/py/lib/test_repo.py b/test/py/lib/test_repo.py
index 3234de5..b882d57 100644
--- a/test/py/lib/test_repo.py
+++ b/test/py/lib/test_repo.py
@@ -167,3 +167,29 @@ class TestRepoOutputLong(TestRepoOutput):
def run_output_matches(self, output):
return output.decode() == self.output
+
+
+OUTPUT_SCRIPT_NULL = R'''#!/usr/bin/env python3
+
+output = {output}
+
+import sys
+sys.stdout.buffer.write(output)
+'''
+
+
+class TestRepoOutputNull(TestRepoOutput):
+ __test__ = False
+
+ OUTPUT = b'123\x00456'
+
+ def __init__(self, *args, **kwargs):
+ self.output = TestRepoOutputNull.OUTPUT
+ super().__init__(*args, **kwargs)
+
+ def _format_output_script(self):
+ assert len(self.output) == 7
+ return OUTPUT_SCRIPT_NULL.format(output=repr(self.output))
+
+ def run_output_matches(self, output):
+ return output == self.output