-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support a string argument to "ignore" describing the reason #102
Comments
Hmm, yeah, it's definitelly something missing. I remember ignore comment syntax was present since 1.3x or earlier, so it shouldn't be a breaking change, we have MSRV 1.49 anyway. It just wasn't thought of. I like your second proposal, if you have resources and time PR is welcome. |
I assumed we want the reason to be optional, for backward compat so that existing cases do not all need updating and can still use a bare I went with |
Since Rust 1.61.0 `cargo test` has included the reason string in the output. The new syntax is optional, so `inconclusive` is still accepted, a reason may be given inside optional brackets `inconclusive["some reason"]`. Parentheses are not used to avoid ambiguity with the output/result. A custom `impl Debug` is used to avoid injecting an unsightly `inconclusivewithreason_litstr_token` into the test name by default. Fixes: frondeus#102
What about |
I think that would be unambiguous? At least I don't think there are any output matchers which start with an I guess it's a question of taste/style and perhaps future direction, happy to defer to you both. |
I think I'm leaning towards |
Since Rust 1.61.0 `cargo test` has included the reason string in the output. The new syntax is optional, so `inconclusive` is still accepted, a reason may be given inside optional brackets `inconclusive["some reason"]`. Parentheses are not used to avoid ambiguity with the output/result. A custom `impl Debug` is used to avoid injecting an unsightly `inconclusivewithreason_litstr_token` into the test name by default. Fixes: frondeus#102
Since Rust 1.61.0 `cargo test` has included the reason string in the output. The new syntax is optional, so `inconclusive` is still accepted, a reason may be given inside optional brackets `inconclusive["some reason"]`. Parentheses are not used to avoid ambiguity with the output/result. A custom `impl Debug` is used to avoid injecting an unsightly `inconclusivewithreason_litstr_token` into the test name by default. Fixes: frondeus#102
* Remove unneeded turbofish It is sufficient to declare the type as the `kw::ignore` case does. * Support giving a reason to inconclusive/ignored cases Since Rust 1.61.0 `cargo test` has included the reason string in the output. The new syntax is optional, so `inconclusive` is still accepted, a reason may be given inside optional brackets `inconclusive["some reason"]`. Parentheses are not used to avoid ambiguity with the output/result. A custom `impl Debug` is used to avoid injecting an unsightly `inconclusivewithreason_litstr_token` into the test name by default. Fixes: #102
Since Rust 1.61.0 the argument to an
ignore
attribute has been printed as part of the test output. So:Will result in:
I believe the syntax has been valid for some releases prior to 1.61.0 (I'm afraid I don't know since when) but was ignored.
It would be great if test_case's
ignore
modifier (andinconclusive
I suppose) could similarly take an option reason and propagate it so thatcargo test
will show it.I'm not sure that
#[test_case(INPUT => ignore = "Some reason" OUTPUT)]
will fit the current syntax but perhaps#[test_case(INPUT => ignore("Some reason") OUTPUT)]
could work?The text was updated successfully, but these errors were encountered: