Skip to content

setting binary mode by default #299

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

Closed
BrianHicks opened this issue Apr 24, 2024 · 4 comments
Closed

setting binary mode by default #299

BrianHicks opened this issue Apr 24, 2024 · 4 comments
Labels
A-trycmd Area: trycmd package enhancement Improve the expected

Comments

@BrianHicks
Copy link

hi! I'm using trycmd to test a utility that generates source code. As part of that, I need \ to not be escaped. Hypothetically, I could use binary mode to accomplish this, but I'm also testing that the invocations in my README are valid, and I don't see anything in the docs that will let me set binary mode. So: can we have a flag on TestCases or similar to set binary mode by default, please?

By the way, it took me an unpleasant amount of time to begin to suspect the test harness was mangling my output. If it were up to me, that wouldn't be the default. I get why it's there (from reading #91) and that it's probably too late to change, but documentation in the trycmd crate would have helped. Would you be open to a PR to say what's going on there? (Or, really, for any of this?)

@epage epage added enhancement Improve the expected A-trycmd Area: trycmd package labels Apr 24, 2024
@epage
Copy link
Contributor

epage commented Apr 24, 2024

While not global, you can set binary on a per-test basis

"binary": {
"default": false,
"type": "boolean"
},

Something I've been considering with structured data support is how to expose control over it, including opting in and opting out, see #93

As this has a lot of overlap with #93, I lean towards closing this and centralizing the conversation there so we can come up with a solution that keeps both use cases in mind. If there is a reason you think this should be kept open separately, let us know!

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2024
@BrianHicks
Copy link
Author

I know I can set it on a per-test basis, but not in a Markdown file… unless I've misunderstood something?

@BrianHicks
Copy link
Author

actually, I tried this just now and it doesn't look like it works. The backslashes in my output are still being converted to forward slashes. Here's the TOML file I'm using; does it look right to you?

bin.name = "elm-duet"
args = ["schema.json"]
binary = true

@epage
Copy link
Contributor

epage commented Apr 26, 2024

Oh right, that only controls the programs input/output.

I'm working some of the underpinings for trycmd at the moment and been wrestling with similar questions in terms of how to handle these things.

@epage epage reopened this Apr 26, 2024
@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trycmd Area: trycmd package enhancement Improve the expected
Projects
None yet
Development

No branches or pull requests

2 participants