- Avoid emitting additional misleading error messages by proc-macro2-diagnostics (#138)
- Allow comments in
test-matrix
macro (#132)
- Drop
proc-macro-error
dependency & improve error messages (#136)
- Update
syn
dependency to 2.0 - Ensure that
test-case
selects correct version of it'score
andmacros
subcrates
- Add
test_matrix
macro: generates test cases from Cartesian product of possible test function argument values (#128)
- Retain
allow
attributes on test functions (#127)
- Copy attribute span to generated test functions so that IDEs recognize them properly as individual tests
- Added LICENSE file to child crates
[IMPORTANT] Starting with 3.0 release we are changing test-case
MSRV policy to support only 3 latest stable releases.
- Split out functional parts of
test-case-macros
crate intotest-case-core
for easy reuse by external libraries
- Use fully qualified
test
macro path to avoid conflicts in workspace (#105)
- Ensure
test-case
depends on correct version oftest-case-macros
- Support
ignore["reason"]
syntax (#102)
- Support
matches_regex
complex test-case (requireswith-regex
feature) (#98) - Support
len
,count
andempty
complex test-cases (#97)
- Support keyword
ignore
on void fn (#100)
- Move macros to separate subcrate so that test-case can export other things (#96)
- Covered missing cases in
matches X if Y
test_case variant (fixes the fact that previous bug fix didn't produce guard code)
matches Pattern if condition
parses correctly (if condition
part wasn't allowed)
=> with |x: T| assert!(x)
custom inline test assertions=> using path::to::fn
custom fn test assertionsignore|inconclusive
can be combined with other keywords (eg.:=> ignore matches Ok(_)
)=> it|is ...
syntax is a built-in (previously requiredhamcrest2
crate integration)- Tested items are left in place where they were defined #77
- Simple test cases allow
Result<(), _>
return types similar to native#[test]
macro
- Significant code refactoring
- Improved test case name selection
- Deprecation of
inconclusive
within test description string - it will no longer act like modifier keyword - Deprecation of
hamcrest2
integration - Deprecation of
allow_result
feature
- Fix regression where
panics
andinconclusive
were not allowed ontest_cases
returning a value - Fix case where
test_case
would allow to return a type when only single attribute was used
test-case
no longer allows returning values from tested function without=>
pattern (thanks to @tarka)- Behaviour can be reenabled via
allow_result
feature
- Behaviour can be reenabled via
- Disabled clippy warning when test-case was generating
assert_eq(bool, bool)
expression.
- Allow usage of fully qualified attribute
#[test_case::test_case]
(thanks to @tomprince)
- Stopped code from emmiting unneded
()
expression in test cases withexpected
fragment (thanks to @martinvonz)
- 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
inconclusive
inside test case name will not be supported starting2.0.0
-
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 ())]
- 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
- Moved
lazy-static
dependency todev-dependencies
- Fixed README - thanks to @luke-biel and @drwilco
- Upgraded
insta
to0.12.0
- Fixed "inconclusive" feature with different cases.
- Added support for
impl Trait
- it worked in v2.x crate.
- Added extra test cases
- Upgraded
version_check
tov0.9.1
- Refreshed readme
- Added CI for stable version of Rust. - thanks to @macisamuele
- Limited crate to Rust 1.29+ - thanks to @macisamuele
- Upgraded
syn
,quote
andproc-macro-2
tov1
- Upgraded
lazy-static
to1.4.0
- Upgraded
insta
to0.11.0
-
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
- 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 all other attributes like
#[should_panic]