Skip to content

Commit 14d62f2

Browse files
committed
update readme
1 parent acdfbe7 commit 14d62f2

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [0.2.3] - 2023-08-29
4+
5+
Updated README.
6+
37
## [0.2.2] - 2023-08-29
48

59
### Added
@@ -58,6 +62,7 @@ There are no functional changes in this release.
5862

5963
(Version 0.1.0 was yanked because of a metadata issue.)
6064

65+
[0.2.3]: https://github.com/nextest-rs/datatest-stable/releases/tag/datatest-stable-0.2.3
6166
[0.2.2]: https://github.com/nextest-rs/datatest-stable/releases/tag/datatest-stable-0.2.2
6267
[0.2.1]: https://github.com/nextest-rs/datatest-stable/releases/tag/datatest-stable-0.2.1
6368
[0.1.3]: https://github.com/nextest-rs/datatest-stable/releases/tag/datatest-stable-0.1.3

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ harness = false
2929

3030
2. Call the `datatest_stable::harness!(testfn, root, pattern)` macro with the following
3131
parameters:
32-
* `testfn` - The test function to be executed on each matching input. This function must have
33-
the type `fn(&Utf8Path) -> datatest_stable::Result<()>`. (`Utf8Path` is part of the
34-
[`camino`](https://docs.rs/camino) library.)
32+
* `testfn` - The test function to be executed on each matching input. This function can be one of:
33+
* `fn(&Path) -> datatest_stable::Result<()>`
34+
* `fn(&Utf8Path) -> datatest_stable::Result<()>` (`Utf8Path` is part of the
35+
[`camino`](https://docs.rs/camino) library, and is re-exported here for convenience.)
3536
* `root` - The path to the root directory where the input files (fixtures) live. This path is
3637
relative to the root of the crate.
3738
* `pattern` - the regex used to match against and select each file to be tested.
@@ -45,14 +46,24 @@ This is an example test. Use it with `harness = false`.
4546

4647
```rust
4748
use datatest_stable::Utf8Path;
49+
use std::path::Path;
4850

49-
fn my_test(path: &Utf8Path) -> datatest_stable::Result<()> {
51+
fn my_test(path: &Path) -> datatest_stable::Result<()> {
5052
// ... write test here
5153

5254
Ok(())
5355
}
5456

55-
datatest_stable::harness!(my_test, "path/to/fixtures", r"^.*/*");
57+
fn my_test_utf8(path: &Utf8Path) -> datatest_stable::Result<()> {
58+
// ... write test here
59+
60+
Ok(())
61+
}
62+
63+
datatest_stable::harness!(
64+
my_test, "path/to/fixtures", r"^.*/*",
65+
my_test_utf8, "path/to/fixtures", r"^.*/*,
66+
);
5667
```
5768
5869
## Minimum supported Rust version (MSRV)

0 commit comments

Comments
 (0)