Skip to content

Commit

Permalink
docs: Update changelog for custom macro attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
foresterre committed Mar 8, 2024
1 parent ce19735 commit eec13f8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
30 changes: 22 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

## [Unreleased]

[Unreleased]: https://github.com/foresterre/storyteller/compare/v2.0.0...HEAD

## [2.1.0] - 2024-03-06

### Added

* Parameterized tests now parse and regenerate the `const`, `async`, `unsafe` and `extern` function qualifiers for test functions.
Expand All @@ -24,13 +20,30 @@ use yare::parameterized;
const extern "C" fn has_reds(streamed_color: &[u8]) {
assert!(streamed_color.first().is_some());
}

```
### Changed

* MSRV is now 1.62
* It is now possible to specify a custom test macro with `#[test_macro(...)]`, which replaces the default `#[test]` attribute for a parameterized test.

**Example**

```rust
use yare::parameterized;

[2.1.0]: https://github.com/foresterre/yare/releases/tag/v2.1.0
#[parameterized(
zero_wait = { 0, 0 },
show_paused = { 500, 0 },
)]
#[test_macro(tokio::test(start_paused = true))]
async fn test(wait: u64, time_elapsed: u128) {
let start = std::time::Instant::now();
tokio::time::sleep(tokio::time::Duration::from_millis(wait)).await;

assert_eq!(time_elapsed, start.elapsed().as_millis());
}

```

[Unreleased]: https://github.com/foresterre/storyteller/compare/v2.0.0...HEAD

## [2.0.0] - 2023-10-16

Expand All @@ -57,6 +70,7 @@ fn example_test(value: Result<u32, String>) -> Result<(), String> {
### Changed

* **Breaking:** Parameter and argument count now must match exactly
* MSRV is now 1.56

### Removed

Expand Down
1 change: 0 additions & 1 deletion yare-tests-integration/src/qualifier_async_complex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use yare::parameterized;
)]
#[test_macro(tokio::test(start_paused = true))]
async fn test(wait: u64, time_elapsed: u128) {
// tokio::time::pause();
let start = std::time::Instant::now();
tokio::time::sleep(tokio::time::Duration::from_millis(wait)).await;

Expand Down

0 comments on commit eec13f8

Please sign in to comment.