Skip to content

Releases: foresterre/yare

Yare v3.0.0

08 Mar 05:24
Compare
Choose a tag to compare

What's Changed

Added

  • Parameterized tests now parse and regenerate the const, async, unsafe and extern function qualifiers for test functions.

Example

use yare::parameterized;

// NB: The underlying test macro also must support these qualifiers. For example, the default `#[test]` doesn't support async and unsafe.

#[parameterized(
    purple = { &[128, 0, 128] },
    orange = { &[255, 127, 0] },
)]
const extern "C" fn has_reds(streamed_color: &[u8]) {
    assert!(streamed_color.first().is_some());
}
  • It is now possible to specify a custom test macro with #[test_macro(...)], which replaces the default #[test] attribute for a parameterized test.

Example

use yare::parameterized;

#[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());
}

Full Changelog: v2.0.0...v3.0.0

v2.0.0

15 Oct 23:26
Compare
Choose a tag to compare
chore: Release yare version 2.0.0

v1.0.2

15 Oct 23:23
Compare
Choose a tag to compare
Bump version to 1.0.2

v1.0.1

15 Oct 23:23
Compare
Choose a tag to compare
Increment version