Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow binary output files #32

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading