Test-Case v1.0.0-alpha-1
Pre-release
Pre-release
·
116 commits
to master
since this release
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
-
Add support for two new keywords:
panicsandmatcheswhich can be applied after=>token.matchesgives possibility to test patterns, like:#[test_case("foo" => matches Some(("foo", _)))]panicsgivesshould_panic(expected="...")for one test_case:#[test_case(true => panics "Panic error message" ; "This should panic")] #[test_case(false => None ; "But this should return None")]
Major improvements
- Add extra unit tests - thanks to @luke-biel
- Replace
parented_test_casewith parsingtest_casedirectly from args - thanks to @luke-biel
Minor improvements
- Moved
lazy-staticdependency todev-dependencies
Upgraded dependencies
- Upgraded
instato0.12.0