1+ <!-- cargo-sync-rdme title [[ -->
12# datatest-stable
2-
3- [ ![ datatest-stable on crates.io] ( https://img.shields.io/crates/v/datatest-stable )] ( https://crates.io/crates/datatest-stable )
4- [ ![ Documentation (latest release)] ( https://img.shields.io/badge/docs-latest-brightgreen )] ( https://docs.rs/datatest-stable/ )
5- [ ![ Documentation (main)] ( https://img.shields.io/badge/docs-main-purple )] ( https://datatest-stable.nexte.st/ )
6- [ ![ License] ( https://img.shields.io/badge/license-Apache-green.svg )] ( ../LICENSE-APACHE )
7- [ ![ License] ( https://img.shields.io/badge/license-MIT-green.svg )] ( ../LICENSE-MIT )
8-
3+ <!-- cargo-sync-rdme ]] -->
4+ <!-- cargo-sync-rdme badge [[ -->
5+ [ ![ Maintenance: passively-maintained] ( https://img.shields.io/badge/maintenance-passively--maintained-yellowgreen.svg? )] ( https://doc.rust-lang.org/cargo/reference/manifest.html#the-badges-section )
6+ ![ License: MIT OR Apache-2.0] ( https://img.shields.io/crates/l/datatest-stable.svg? )
7+ [ ![ crates.io] ( https://img.shields.io/crates/v/datatest-stable.svg?logo=rust )] ( https://crates.io/crates/datatest-stable )
8+ [ ![ docs.rs] ( https://img.shields.io/docsrs/datatest-stable.svg?logo=docs.rs )] ( https://docs.rs/datatest-stable )
9+ [ ![ Rust: ^1.72.0] ( https://img.shields.io/badge/rust-^1.72.0-93450a.svg?logo=rust )] ( https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field )
10+ <!-- cargo-sync-rdme ]] -->
11+ <!-- cargo-sync-rdme rustdoc [[ -->
912` datatest-stable ` is a test harness intended to write * file-driven* or * data-driven* tests,
1013where individual test cases are specified as files and not as code.
1114
@@ -24,11 +27,11 @@ organization](https://github.com/nextest-rs/) on GitHub.
2427
25281 . Configure the test target by setting ` harness = false ` in ` Cargo.toml ` :
2629
27- ``` toml
30+ ```` toml
2831[[test ]]
2932name = " <test target name>"
3033harness = false
31- ```
34+ ````
3235
33362 . Call the ` datatest_stable::harness!(testfn, root, pattern) ` macro with the following
3437 parameters:
@@ -37,15 +40,15 @@ harness = false
3740 of:
3841 * ` fn(&Path) -> datatest_stable::Result<()> `
3942 * ` fn(&Utf8Path) -> datatest_stable::Result<()> ` (` Utf8Path ` is part of the
40- [ ` camino ` ] ( https://docs.rs/camino ) library, and is re-exported here for convenience.)
43+ [ ` camino ` ] ( https://docs.rs/camino ) library, and is re-exported here for convenience.)
4144 * ` fn(&P, String) -> datatest_stable::Result<()> ` where ` P ` is ` Path ` or ` Utf8Path ` . If the
4245 extra ` String ` parameter is specified, the contents of the file will be loaded and passed in
4346 as a string (erroring out if that failed).
4447 * ` fn(&P, Vec<u8>) -> datatest_stable::Result<()> ` where ` P ` is ` Path ` or ` Utf8Path ` . If the
4548 extra ` Vec<u8> ` parameter is specified, the contents of the file will be loaded and passed
4649 in as a ` Vec<u8> ` (erroring out if that failed).
4750* ` root ` - The path to the root directory where the input files (fixtures) live. This path is
48- relative to the root of the crate (the directory where the crate' s ` Cargo.toml ` is located).
51+ relative to the root of the crate (the directory where the crate’ s ` Cargo.toml ` is located).
4952* ` pattern ` - a regex used to match against and select each file to be tested. Extended regexes
5053 with lookaround and backtracking are supported via the
5154 [ ` fancy_regex ` ] ( https://docs.rs/fancy-regex ) crate.
@@ -57,7 +60,7 @@ The three parameters can be repeated if you have multiple sets of data-driven te
5760
5861This is an example test. Use it with ` harness = false ` .
5962
60- ``` rust
63+ ```` rust
6164use datatest_stable :: Utf8Path ;
6265use std :: path :: Path ;
6366
@@ -77,7 +80,7 @@ datatest_stable::harness!(
7780 my_test , " path/to/fixtures" , r " ^.*/*" ,
7881 my_test_utf8 , " path/to/fixtures" , r " ^.*/*" ,
7982);
80- ```
83+ ````
8184
8285## Minimum supported Rust version (MSRV)
8386
@@ -89,15 +92,9 @@ version update; at any time, Rust versions from at least the last 6 months are s
8992* [ ` datatest ` ] ( https://crates.io/crates/datatest ) : the original inspiration for this crate, with
9093 more features but targeting nightly Rust.
9194* [ Data-driven testing] ( https://en.wikipedia.org/wiki/Data-driven_testing )
95+ <!-- cargo-sync-rdme ]] -->
9296
9397## License
9498
9599This project is available under the terms of either the [ Apache 2.0 license] ( LICENSE-APACHE ) or the [ MIT
96100license] ( LICENSE-MIT ) .
97-
98- <!--
99- README.md is generated from README.tpl by cargo readme. To regenerate:
100-
101- cargo install cargo-readme
102- ./scripts/regenerate-readmes.sh
103- -->
0 commit comments