Skip to content

Commit

Permalink
Merge pull request #32 from cucapra/bin-outputs
Browse files Browse the repository at this point in the history
Allow binary output files
  • Loading branch information
sampsyo authored Jul 12, 2024
2 parents 8a74a6d + a9e0174 commit 283b200
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion test/binary/bin.out
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bin
����
2 changes: 1 addition & 1 deletion test/binary/turnt.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
command = "echo {base} {args}"
command = "cat {filename}"
binary = true
4 changes: 2 additions & 2 deletions turnt/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 283b200

Please sign in to comment.