-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
tests with #[should_panic] should print a message on failure #60790
Copy link
Copy link
Closed
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Metadata
Metadata
Assignees
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
When a
#[should_panic]#[test]fails because there was no panic it should produce an error message to that effect.For example, the following test:
when run with
cargo testproduces the following output:There is no indication why it failed. Which can be problematic if the test itself is created by a macro. Example: https://github.com/BurntSushi/fst/blob/master/src/raw/tests.rs#L131-L140