test-case-macros
Provides #[test_case(...)] procedural macro attribute for generating parametrized test cases easily
3.3.1
55M downloads/mo
#1163 most downloaded on crates.io
frondeus/test-case
What this package is like to depend on
Last release 3 years ago
no release in 18 months
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 9 of 9 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
9 releases · first in 2022
0 releases in the last 12 months
see the full history below
Release timeline
9 releases · May 2022 to Nov 2023Releases
latest 9-
3.3.117 Nov 2023Release notes
Open source →What's Changed
- Avoid emitting unnecessary error messages by test cases & remove proc-macro2-diagnostics dependency by @dtolnay in #138
New Contributors
Full Changelog: v3.3.0...v3.3.1
Release notes
Open source →Fixes
- Avoid emitting additional misleading error messages by proc-macro2-diagnostics (#138)
-
3.3.017 Nov 2023Release notes
Open source →What's Changed
- Fix test_matrix example that does not compile in README by @ollien in #133
- Add the ability to have comments in matrix tests by @ollien in #132
- Remove proc-macro-error dependency by @tamird in #136
- .github: replace actions-rs with dtolnay/rust-toolchain, add caching by @tamird in #137
New Contributors
Full Changelog: v3.2.1...v3.3.0
Release notes
Open source →Features
- Allow comments in
test-matrixmacro (#132)
Improvements
- Drop
proc-macro-errordependency & improve error messages (#136)
-
3.2.117 Sep 2023Release notes
Open source →- Update
syndependency - Ensure that
test-casetargets latestcoreandmacrossubcrates.
Full Changelog: v3.2.0...v3.2.1
Release notes
Open source →Improvements
- Update
syndependency to 2.0 - Ensure that
test-caseselects correct version of it'scoreandmacrossubcrates
- Update
-
3.2.016 Sep 2023Release notes
Open source →What's Changed
- Retain allow attribute in test_case macro by @JohnPeel in #127
- Add test_matrix macro by @overhacked in #128
New Contributors
- @JohnPeel made their first contribution in #127
- @overhacked made their first contribution in #128
Full Changelog: v3.1.0...v3.2.0
Release notes
Open source →Features
- Add
test_matrixmacro: generates test cases from Cartesian product of possible test function argument values (#128)
Improvements
- Retain
allowattributes on test functions (#127)
-
3.1.002 Apr 2023Release notes
Open source →What's Changed
- Set MSRV in
Cargo.tomlto 1.58.1 by @samueltardieu in #116 - Set the span of test function Idents to the span of the origin attribute by @rpwachowski in #119
New Contributors
- @samueltardieu made their first contribution in #116
- @rpwachowski made their first contribution in #119
Full Changelog: v3.0.0...v3.1.0
Release notes
Open source →Features
- Copy attribute span to generated test functions so that IDEs recognize them properly as individual tests
Improvements
- Added LICENSE file to child crates
- Set MSRV in
-
3.0.013 Feb 2023Release notes
Open source →Overview
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 thetest_caseattribute.
Under the hood, all test cases that share the same body are grouped into a mod, giving clear and readable test results.Changes
- Split out
test-case-corecrate, allowing easier reuse in external crates. By @evforde
IMPORTANT
Starting with the 3.0 release, we are changing
test-caseMSRVpolicy. We no longer can maintain our goal of only bumpingMSRVwith 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 keepMSRVbreakage 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 uptest-case's maintenance processes and add more features in the coming months.Release notes
Open source →[IMPORTANT] Starting with 3.0 release we are changing
test-caseMSRV policy to support only 3 latest stable releases.Improvements
- Split out functional parts of
test-case-macroscrate intotest-case-corefor easy reuse by external libraries
- Split out
-
2.2.201 Oct 2022Release notes
Open source →What's Changed
- Use fully qualified #[test] attribute path by @alanbriolat in #105
New Contributors
- @alanbriolat made their first contribution in #105
Full Changelog: v2.2.1...v2.2.2
Release notes
Open source →Fixes
- Use fully qualified
testmacro path to avoid conflicts in workspace (#105)
-
2.2.121 Jul 2022Release notes
Open source →Bugfix release - ensure
test-casedepends on correct version oftest-case-macros
Full Changelog: v2.2.0...v2.2.1 -
2.1.018 May 2022Release notes
Open source →What's Changed
- Refactoring: move test-case macro to separate subcrate by @luke-biel in #96
- Add 'len', 'count' and 'empty' complex assertions by @luke-biel in #97
- Add
match_regexto complex test-cases by @luke-biel in #98 - Allow keywords in void fn by @luke-biel in #100
Full Changelog: v2.0.2...v2.1.0
Release notes
Open source →Features
- Support
matches_regexcomplex test-case (requireswith-regexfeature) (#98) - Support
len,countandemptycomplex test-cases (#97)
Fixes
- Support keyword
ignoreon void fn (#100)
Improvements
- Move macros to separate subcrate so that test-case can export other things (#96)