Releases: frondeus/test-case
TestCase - v1.0.1
Legacy release supporting MSRV < 1.39, including syn::export fix
Test-Case v1.1.0
New features
- Added support for using
hamcrest2
assertions with test case - Enabled support of
async
via tokio or similar - Enabled attribute passthrough for test cases - it means that you can combine
test-case
with other testing frameworks,
given at least one#[test_case]
attribute appears before mentioned framework in testing function
Deprecation
inconclusive
inside test case name will not be supported starting2.0.0
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
,matches
andinconclusive
which can be applied after=>
token.matches
gives possibility to test patterns, like:#[test_case("foo" => matches Some(("foo", _)))]
panics
givesshould_panic(expected="...")
for onetest_case
:#[test_case(true => panics "Panic error message" ; "This should panic")] #[test_case(false => None ; "But this should return None")]
inconclusive
ignores 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_case
with parsingtest_case
directly from args - thanks to @luke-biel - Added keeping trailing underscores in names - thanks to @rzumer
Minor improvements
- Moved
lazy-static
dependency todev-dependencies
- Fixed README - thanks to @luke-biel and @drwilco
Upgraded dependencies
- Upgraded
insta
to0.12.0
Test-Case v1.0.0-alpha-1
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:
panics
andmatches
which can be applied after=>
token.matches
gives possibility to test patterns, like:#[test_case("foo" => matches Some(("foo", _)))]
panics
givesshould_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_case
with parsingtest_case
directly from args - thanks to @luke-biel
Minor improvements
- Moved
lazy-static
dependency todev-dependencies
Upgraded dependencies
- Upgraded
insta
to0.12.0
Test-Case v0.3.3
Bugfixes
- Fixed "inconclusive" feature with different cases.
#[test_case(1 ; "this test is inconclusive and will always be")] #[test_case(2 ; "this test is also Inconclusive")] #[test_case(3 ; "this test is also INCONCLUSIVE even uppercase")] #[test_case(4 ; "this test is also iNCONCLUSIVE even inverted caps")]
Test-Case v0.3.2
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.
Bugfixes
- Added support for
impl Trait
- it worked in 2.x crate.
Minor improvements
- Added extra test cases
Upgraded dependencies
- Upgraded
version_check
tov0.9.1
Test-Case v0.3.1
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.
Breaking changes
- Crate has new maintainer: Wojciech Polak ✋ 🎉
- Crate has new name, as
test-case-derive
had no meaning forderive
part. - Delimiter for test case description is
;
instead of::
.
Reason: ::
is valid part of expression and rustc treats const variable as path
New features
- Proper error propagation 🎉
When there is for example a typo in function body, rustc can now show location
of it instead of test_case location. - Internally for tests crate uses
cargo insta
for snapshot testing - Attribute is now compatible with all other attributes like
#[should_panic]
, however these attributes will be applied on every test case
Minor improvements:
- Refreshed readme
- Added CI for stable version of Rust. - thanks to @macisamuele
- Limited crate to Rust 1.29+ - thanks to @macisamuele
Upgraded dependencies:
- Upgraded syn, quote and proc-macro-2 to v1
- Upgraded lazy-static to 1.4.0
- Upgraded insta to 0.11.0