NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #1140 most downloaded on crates.io
Provides #[test_case(...)] procedural macro attribute for generating parametrized test cases easily
Last release 14 days ago
23 Sep 2026
Ships unpredictably
gaps range from 9 days to 2.9 years
Nearly every release is documented
notes for 24 of 25 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
30 releases · first in 2019
Adds test case number to automatically distinguish test cases with the same generated name ( #151 ) Instead of having a conflict in example like this:
#[test_case(42)]
#[test_case("42")]
fn cases_are_enumerated(value: impl std::fmt::Display) {
assert_eq!("42", &value.to_string())
}It now generates prefix name for each test case. In all cases:
test cases_are_enumerated::test_case_1_42_expects ... ok
test cases_are_enumerated::test_case_2_42_expects ... ok
assert_eq!(result, expectation) instead of previous assert_eq!(expectation, result);One column per quarter.
Avoid emitting unnecessary error messages by test cases & remove proc-macro2-diagnostics dependency by @dtolnay in #138
Full Changelog: v3.3.0...v3.3.1
Fix test_matrix example that does not compile in README by @ollien in #133
Full Changelog: v3.2.1...v3.3.0
test-matrix macro (#132)proc-macro-error dependency & improve error messages (#136)Ensure that test-case targets latest core and macros subcrates.
syn dependencytest-case targets latest core and macros subcrates.Full Changelog: v3.2.0...v3.2.1
syn dependency to 2.0test-case selects correct version of it's core and macros subcratesRetain allow attribute in test_case macro by @JohnPeel in #127
Full Changelog: v3.1.0...v3.2.0
test_matrix macro: generates test cases from Cartesian product of possible test function argument values (#128)allow attributes on test functions (#127)Set MSRV in Cargo.toml to 1.58.1 by @samueltardieu in #116
Cargo.toml to 1.58.1 by @samueltardieu in #116Full Changelog: v3.0.0...v3.1.0
This crate provides the #[test_case] procedural macro attribute that generates multiple parametrized tests using one body with different input paramet
This crate provides the #[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 the test_case attribute.
Under the hood, all test cases that share the same body are grouped into a mod, giving clear and readable test results.
test-case-core crate, allowing easier reuse in external crates. By @evfordeStarting with the 3.0 release, we are changing test-case MSRV policy. We no longer can maintain our goal of only bumping MSRV with major SemVer releases partly due to how fast rust landscape changes and partly to how the rest of the rust ecosystem prefers instead not to keep MSRV breakage treated as SemVer breakage, making stricter policies hard to maintain with limited resources we have. The current goal is to support up to 3 of the latest stable releases.
We hope that with this change, we'll be able to speed up test-case's maintenance processes and add more features in the coming months.
[IMPORTANT] Starting with 3.0 release we are changing test-case MSRV policy to support only 3 latest stable releases.
test-case-macros crate into test-case-core for easy reuse by external librariesUse fully qualified #[test] attribute path by @alanbriolat in #105
Full Changelog: v2.2.1...v2.2.2
test macro path to avoid conflicts in workspace (#105)Bugfix release - ensure test-case depends on correct version of test-case-macros Full Changelog : v2.2.0...v2.2.1
Bugfix release - ensure test-case depends on correct version of test-case-macros
Full Changelog: v2.2.0...v2.2.1
Allow ignore reason by @ijc in #103
Refactoring: move test-case macro to separate subcrate by @luke-biel in #96
match_regex to complex test-cases by @luke-biel in #98Full Changelog: v2.0.2...v2.1.0
matches_regex complex test-case (requires with-regex feature) (#98)len, count and empty complex test-cases (#97)ignore on void fn (#100)Covered missing cases in matches X if Y *test_case* variant (fixes the fact that previous bug fix didn't produce guard code)
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)
matches Pattern if condition parses correctly (if condition part wasn't allowed)Deprecation of inconclusive within test description string - it will no longer act like modifier keyword
=> 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 required hamcrest2 crate integration)Result<(), _> return types similar to native #[test] macroinconclusive within test description string - it will no longer act like modifier keywordhamcrest2 integrationallow_result featureNothing published for this version
Nothing published for this version
Nothing published for this version
Fix regression where panics and inconclusive were not allowed on test_cases returning a value
panics and inconclusive were not allowed on test_cases returning a valuetest_case would allow to return a type when only single attribute was usedtest-case no longer allows returning values from tested function without => pattern (thanks to @tarka)
test-case no longer allows returning values from tested function without => pattern (thanks to @tarka)
allow_result featureDisabled clippy warning when test-case was generating assert_eq(bool, bool) expression.
assert_eq(bool, bool) expression.Allow usage of fully qualified attribute #[test_case::test_case] (thanks to @tomprince)
#[test_case::test_case] (thanks to @tomprince)() expression in test cases with expected fragment (thanks to @martinvonz)Added support for using hamcrest2 assertions with test case
hamcrest2 assertions with test caseasync via tokio or similartest-case with other testing frameworks,
given at least one #[test_case] attribute appears before mentioned framework in testing functioninconclusive inside test case name will not be supported starting 2.0.0Nothing published for this version
Added support for three new keywords: panics, matches and inconclusive which can be applied after => token.
Added support for three new keywords: panics, matches and inconclusive which can be applied after => token.
matches gives possibility to test patterns, like:
#[test_case("foo" => matches Some(("foo", _)))]
panics gives should_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")]
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 ())]
parented_test_case with parsing test_case directly from args - thanks to @luke-biellazy-static dependency to dev-dependenciesinsta to 0.12.0Nothing published for this version
Fixed "inconclusive" feature with different cases.
Nothing published for this version
Added support for impl Trait - it worked in v2.x crate.
impl Trait - it worked in v2.x crate.version_check to v0.9.1Added CI for stable version of Rust. - thanks to @macisamuele
syn, quote and proc-macro-2 to v1lazy-static to 1.4.0insta to 0.11.0Crate has new maintainer: Wojciech Polak :hand: :tada:
Crate has new maintainer: Wojciech Polak :hand: :tada:
Crate has new name, as test-case-derive had no meaning for derive part.
Delimiter for test case description is ; instead of ::.
Reason: :: is valid part of expression and rustc treats const variable as path
test_case location.cargo insta for snapshot testing#[should_panic]Your coding agent can read these notes before it upgrades. Set up the MCP server →