-
Notifications
You must be signed in to change notification settings - Fork 43
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
Named tests #160
Comments
Ok, What we can do is simply add a sanitized string from the expression by just take valid characters and discard the others. Maybe some chars can be replaced by |
Thanks for checking this! and this sounds good |
I'll limit the rendered part to 64 chars.... It should be enough. |
it would also be nice to be able to specify a string name for parameterized tests as well, similar to: https://docs.rs/test-case/latest/test_case/#example-usage |
You can already do it for cases... not for values. https://docs.rs/rstest/latest/rstest/attr.rstest.html#optional-case-description For values doesn't have too much sense IMHO |
@TomPridham Same example in rstest: #[rstest]
#[case::when_both_operands_are_negative(-2, -4]
#[case::when_both_operands_are_positive(2, 4)]
#[case::when_operands_are_swapped(4, 2)]
fn multiplication_tests(x: i8, y: i8) {
let actual = (x * y).abs();
assert_eq!(8, actual)
} Output should be something like
You can find the motivation of why I choose to leave the |
Released |
My test has a signature like so:
And when the tests are run, on failure/success I get output like this
It is very hard to know which application/agent failed, so is there a way to have the name of the tests similar to the name of the variants when using #[values]?
Defining cases explicitly can be a mess, and I don't want to do
#[case::go_job(App::GO, Agent::Job)]
or use #[trace]/#[notrace]Thanks!
The text was updated successfully, but these errors were encountered: