Test-Case v1.0.0
Overview
This crate provides #[test_case] procedural macro attribute that generates multiple parametrized tests using one body with different input parameters.
A test is generated for each data set passed in test_case attribute.
Under the hood, all test cases that share same body are grouped into mod, giving clear and readable test results.
New features
-
Added support for three new keywords:
panics,matchesandinconclusivewhich can be applied after=>token.matchesgives possibility to test patterns, like:#[test_case("foo" => matches Some(("foo", _)))]panicsgivesshould_panic(expected="...")for onetest_case:#[test_case(true => panics "Panic error message" ; "This should panic")] #[test_case(false => None ; "But this should return None")]
inconclusiveignores one specific test case.- thanks to @luke-biel#[test_case("42")] #[test_case("XX" ; "inconclusive - parsing letters temporarily doesn't work, but it's ok")] #[test_case("na" => inconclusive ())]
Major improvements
- Added extra unit tests - thanks to @luke-biel
- Replace
parented_test_casewith parsingtest_casedirectly from args - thanks to @luke-biel - Added keeping trailing underscores in names - thanks to @rzumer
Minor improvements
- Moved
lazy-staticdependency todev-dependencies - Fixed README - thanks to @luke-biel and @drwilco
Upgraded dependencies
- Upgraded
instato0.12.0