diff --git a/CHANGELOG.md b/CHANGELOG.md index 42441f7..b9b3723 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Turnt Changelog - You can now configure `todo` tests to ignore failures. - Fix the reported test count when running multiple environments. +- Fix a crash when a test command outputs binary data. 1.11.0 (2023-07-08) ------------------- diff --git a/test/binary/bin.out b/test/binary/bin.out index ba077a4..77f1b96 100644 --- a/test/binary/bin.out +++ b/test/binary/bin.out @@ -1 +1 @@ -bin +ÞÊû­ \ No newline at end of file diff --git a/test/binary/turnt.toml b/test/binary/turnt.toml index f74636f..02e4540 100644 --- a/test/binary/turnt.toml +++ b/test/binary/turnt.toml @@ -1,2 +1,2 @@ -command = "echo {base} {args}" +command = "cat {filename}" binary = true diff --git a/turnt/run.py b/turnt/run.py index da7a948..6029507 100644 --- a/turnt/run.py +++ b/turnt/run.py @@ -52,10 +52,10 @@ def check_result(cfg: Config, test: Test, stdout=sys.stderr.buffer) # Read actual & expected output. - with open(output_file) as f: + with open(output_file, 'rb') as f: actual = f.read() if os.path.isfile(saved_file): - with open(saved_file) as f: + with open(saved_file, 'rb') as f: expected = f.read() else: expected = None