diff --git a/Cargo.toml b/Cargo.toml index 05868f6..17bf152 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ exclude = ["tests/snapshots/**/*"] [features] with-regex = ["regex", "test-case-macros/with-regex"] +with-assert-override = ["test-case-macros/with-assert-override"] [badges] maintenance = { status = "actively-developed" } @@ -29,10 +30,11 @@ regex = { version = "1.5", optional = true } [dev-dependencies] insta = "1.12" itertools = "0.10" +regex = "1.5" + indexmap = "=1.8.2" serde_yaml = "=0.8.25" linked-hash-map = "=0.5.4" -regex = "1.5" once_cell = "=1.13.0" [workspace] diff --git a/crates/test-case-macros/Cargo.toml b/crates/test-case-macros/Cargo.toml index fa8f87b..c3735ac 100644 --- a/crates/test-case-macros/Cargo.toml +++ b/crates/test-case-macros/Cargo.toml @@ -14,6 +14,7 @@ exclude = ["tests/snapshots/**/*"] [features] with-regex = [] +with-assert-override = [] [badges] maintenance = { status = "actively-developed" } diff --git a/crates/test-case-macros/src/assert_override.rs b/crates/test-case-macros/src/assert_override.rs new file mode 100644 index 0000000..2c4ea51 --- /dev/null +++ b/crates/test-case-macros/src/assert_override.rs @@ -0,0 +1,112 @@ +use proc_macro2::TokenStream as TokenStream2; +use quote::quote; +use syn::parse::{Parse, ParseStream}; +use syn::punctuated::Punctuated; +use syn::{parse_quote, Token}; + +mod kw { + syn::custom_keyword!(assert_eq); + syn::custom_keyword!(assert); +} + +#[derive(PartialEq, Debug)] +enum AssertOverrideKind { + AssertEq, + Assert, +} + +impl Parse for AssertOverrideKind { + fn parse(input: ParseStream) -> syn::Result { + let lookahead = input.lookahead1(); + if lookahead.peek(kw::assert_eq) { + let _ = input.parse::()?; + Ok(AssertOverrideKind::AssertEq) + } else if lookahead.peek(kw::assert) { + let _ = input.parse::()?; + Ok(AssertOverrideKind::Assert) + } else { + Err(lookahead.error()) + } + } +} + +struct AssertOverride { + override_kind: AssertOverrideKind, + path: syn::Path, +} + +impl Parse for AssertOverride { + fn parse(input: ParseStream) -> syn::Result { + let override_kind = input.parse::()?; + let _ = input.parse::()?; + let path = input.parse::()?; + Ok(Self { + override_kind, + path, + }) + } +} + +pub struct AssertOverrides { + overrides: Vec, +} + +impl Parse for AssertOverrides { + fn parse(input: ParseStream) -> syn::Result { + let overrides = Punctuated::::parse_terminated(input)?; + Ok(Self { + overrides: overrides.into_iter().collect(), + }) + } +} + +pub fn assert_override_impl(items: AssertOverrides) -> TokenStream2 { + let mut assert_eq = None; + let mut assert = None; + + for item in items.overrides { + match item.override_kind { + AssertOverrideKind::AssertEq => assert_eq = Some(item.path), + AssertOverrideKind::Assert => assert = Some(item.path), + } + } + + let assert_eq = assert_eq.unwrap_or_else(|| parse_quote!(std::assert_eq)); + let assert = assert.unwrap_or_else(|| parse_quote!(std::assert)); + + quote! { + mod __test_case_assert_override { + use super::*; + + #[allow(unused_imports)] + pub use #assert_eq as assert_eq; + + #[allow(unused_imports)] + pub use #assert as assert; + } + } +} + +#[cfg(test)] +mod tests { + use quote::quote; + + #[test] + fn can_parse_assert_override() { + let input = quote! { + assert_eq: my_assert_eq, assert: my_assert, + }; + let items = syn::parse2::(input).unwrap(); + assert_eq!(items.overrides.len(), 2); + assert_eq!( + items.overrides[0].override_kind, + super::AssertOverrideKind::AssertEq + ); + assert_eq!(items.overrides[0].path, syn::parse_quote!(my_assert_eq)); + assert_eq!( + items.overrides[1].override_kind, + super::AssertOverrideKind::Assert + ); + assert_eq!(items.overrides[1].path, syn::parse_quote!(my_assert)); + } +} diff --git a/crates/test-case-macros/src/complex_expr.rs b/crates/test-case-macros/src/complex_expr.rs index 477964f..b945574 100644 --- a/crates/test-case-macros/src/complex_expr.rs +++ b/crates/test-case-macros/src/complex_expr.rs @@ -3,6 +3,8 @@ use proc_macro2::Group; use proc_macro2::TokenStream; use quote::{quote, TokenStreamExt}; use std::fmt::{Display, Formatter}; +use std::str::FromStr; +use syn::__private::TokenStream2; use syn::parse::{Parse, ParseStream}; use syn::{parse_quote, Expr}; @@ -209,7 +211,10 @@ impl ComplexTestCase { pub fn assertion(&self) -> TokenStream { let tokens = self.boolean_check(); - quote! { assert!(#tokens) } + let assert_fn_ident = + TokenStream2::from_str(crate::assertions::ASSERT_OVERRIDE_ASSERT_PATH).unwrap(); + + quote! { #assert_fn_ident!(#tokens) } } fn boolean_check(&self) -> TokenStream { diff --git a/crates/test-case-macros/src/expr.rs b/crates/test-case-macros/src/expr.rs index cd2e104..4195f85 100644 --- a/crates/test-case-macros/src/expr.rs +++ b/crates/test-case-macros/src/expr.rs @@ -5,6 +5,7 @@ use crate::TokenStream2; use quote::ToTokens; use std::collections::HashSet; use std::fmt::{Display, Formatter}; +use std::str::FromStr; use syn::parse::{Parse, ParseStream}; use syn::token::If; use syn::{parse_quote, Attribute, Expr, Pat, Token}; @@ -118,8 +119,11 @@ impl Display for TestCaseResult { impl TestCaseExpression { pub fn assertion(&self) -> TokenStream2 { + let assert_fn_ident = + TokenStream2::from_str(crate::assertions::ASSERT_OVERRIDE_ASSERT_EQ_PATH).unwrap(); + match &self.result { - TestCaseResult::Simple(expr) => parse_quote! { assert_eq!(#expr, _result) }, + TestCaseResult::Simple(expr) => parse_quote! { #assert_fn_ident!(#expr, _result) }, TestCaseResult::Matching(pat, guard) => { let pat_str = pat.to_token_stream().to_string(); diff --git a/crates/test-case-macros/src/lib.rs b/crates/test-case-macros/src/lib.rs index 64ac1c0..8949799 100644 --- a/crates/test-case-macros/src/lib.rs +++ b/crates/test-case-macros/src/lib.rs @@ -1,15 +1,15 @@ extern crate proc_macro; use proc_macro::TokenStream; - -use syn::{parse_macro_input, ItemFn}; - use proc_macro2::TokenStream as TokenStream2; use quote::quote; use syn::parse_quote; use syn::spanned::Spanned; +use syn::{parse_macro_input, ItemFn}; use test_case::TestCase; +#[cfg(feature = "with-assert-override")] +mod assert_override; mod comment; mod complex_expr; mod expr; @@ -17,6 +17,18 @@ mod modifier; mod test_case; mod utils; +#[cfg(feature = "with-assert-override")] +mod assertions { + pub const ASSERT_OVERRIDE_ASSERT_EQ_PATH: &str = + "crate::__test_case_assert_override::assert_eq"; + pub const ASSERT_OVERRIDE_ASSERT_PATH: &str = "crate::__test_case_assert_override::assert"; +} +#[cfg(not(feature = "with-assert-override"))] +mod assertions { + pub const ASSERT_OVERRIDE_ASSERT_EQ_PATH: &str = "core::assert_eq"; + pub const ASSERT_OVERRIDE_ASSERT_PATH: &str = "core::assert"; +} + /// Generates tests for given set of data /// /// In general, test case consists of four elements: @@ -68,6 +80,15 @@ pub fn test_case(args: TokenStream, input: TokenStream) -> TokenStream { render_test_cases(&test_cases, item) } +/// Prepares crate for use with `#[test_case]` macro and custom implementations of `assert_eq` and `assert_ne`. +#[cfg(feature = "with-assert-override")] +#[proc_macro] +pub fn test_case_assert_override(item: TokenStream) -> TokenStream { + let items = parse_macro_input!(item as crate::assert_override::AssertOverrides); + + assert_override::assert_override_impl(items).into() +} + #[allow(unused_mut)] fn render_test_cases(test_cases: &[TestCase], mut item: ItemFn) -> TokenStream { let mut rendered_test_cases = vec![]; diff --git a/scripts/test_all.sh b/scripts/test_all.sh index bea9068..6b90653 100755 --- a/scripts/test_all.sh +++ b/scripts/test_all.sh @@ -4,8 +4,8 @@ set -e cargo clean -cargo +nightly clippy --all-targets --all-features -- -D warnings -cargo +nightly fmt --all +cargo clippy --all-targets --all-features -- -D warnings +cargo fmt --all find . -name 'target' | xargs rm -rf SNAPSHOT_DIR=rust-stable cargo +stable test --workspace --all-features find . -name 'target' | xargs rm -rf diff --git a/src/lib.rs b/src/lib.rs index cdcc994..cd4d124 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,5 +54,8 @@ pub use test_case_macros::test_case; pub use test_case_macros::test_case as case; +#[cfg(feature = "with-assert-override")] +pub use test_case_macros::test_case_assert_override; + #[cfg(feature = "with-regex")] pub use regex::*; diff --git a/tests/acceptance_cases/cases_can_override_default_assert_macros/Cargo.toml b/tests/acceptance_cases/cases_can_override_default_assert_macros/Cargo.toml new file mode 100644 index 0000000..8872fd3 --- /dev/null +++ b/tests/acceptance_cases/cases_can_override_default_assert_macros/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "cases_can_override_default_assert_macros" +version = "0.1.0" +edition = "2018" + +[lib] +name = "cases_can_panic" +path = "src/lib.rs" +doctest = false + +[dev-dependencies] +test-case = { path = "../../../", features = ["with-assert-override"] } + +[workspace] diff --git a/tests/acceptance_cases/cases_can_override_default_assert_macros/src/lib.rs b/tests/acceptance_cases/cases_can_override_default_assert_macros/src/lib.rs new file mode 100644 index 0000000..8a2405d --- /dev/null +++ b/tests/acceptance_cases/cases_can_override_default_assert_macros/src/lib.rs @@ -0,0 +1,30 @@ +use test_case::test_case_assert_override; +use test_case::test_case; + +test_case_assert_override!( + assert_eq: crate::assert_eq, + assert: std::assert, +); + +pub mod testing_utils { + #[macro_export] + macro_rules! assert_eq { + ($left:expr, $right:expr) => { + if $left != $right { + panic!("custom assertion failed: `(left == right)`\n left: `{:?}`,\n right: `{:?}`", $left, $right) + } + }; + } +} + +#[test_case(1 => 1)] +#[test_case(1 => 2)] +fn test(i: i32) -> i32 { + i +} + +#[test_case(1 => is eq 1)] +#[test_case(1 => is eq 2)] +fn test_2(i: i32) -> i32 { + i +} diff --git a/tests/acceptance_cases/cases_can_override_default_assert_macros_partial/Cargo.toml b/tests/acceptance_cases/cases_can_override_default_assert_macros_partial/Cargo.toml new file mode 100644 index 0000000..8872fd3 --- /dev/null +++ b/tests/acceptance_cases/cases_can_override_default_assert_macros_partial/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "cases_can_override_default_assert_macros" +version = "0.1.0" +edition = "2018" + +[lib] +name = "cases_can_panic" +path = "src/lib.rs" +doctest = false + +[dev-dependencies] +test-case = { path = "../../../", features = ["with-assert-override"] } + +[workspace] diff --git a/tests/acceptance_cases/cases_can_override_default_assert_macros_partial/src/lib.rs b/tests/acceptance_cases/cases_can_override_default_assert_macros_partial/src/lib.rs new file mode 100644 index 0000000..0a2a041 --- /dev/null +++ b/tests/acceptance_cases/cases_can_override_default_assert_macros_partial/src/lib.rs @@ -0,0 +1,18 @@ +use test_case::test_case_assert_override; +use test_case::test_case; + +test_case_assert_override!( + assert: std::assert, +); + +#[test_case(1 => 1)] +#[test_case(1 => 2)] +fn test(i: i32) -> i32 { + i +} + +#[test_case(1 => is eq 1)] +#[test_case(1 => is eq 2)] +fn test_2(i: i32) -> i32 { + i +} diff --git a/tests/acceptance_cases/cases_can_panic/Cargo.toml b/tests/acceptance_cases/cases_can_panic/Cargo.toml index 38bd89f..9c2b0dd 100644 --- a/tests/acceptance_cases/cases_can_panic/Cargo.toml +++ b/tests/acceptance_cases/cases_can_panic/Cargo.toml @@ -3,9 +3,6 @@ name = "cases_can_panic" version = "0.1.0" edition = "2018" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] [lib] name = "cases_can_panic" path = "src/lib.rs" diff --git a/tests/acceptance_tests.rs b/tests/acceptance_tests.rs index 389133b..e7e1da9 100644 --- a/tests/acceptance_tests.rs +++ b/tests/acceptance_tests.rs @@ -142,3 +142,13 @@ fn cases_can_use_regex() { fn features_produce_human_readable_errors() { run_acceptance_test!("features_produce_human_readable_errors") } + +#[test] +fn cases_can_override_default_assert_macros() { + run_acceptance_test!("cases_can_override_default_assert_macros") +} + +#[test] +fn cases_can_override_default_assert_macros_partial() { + run_acceptance_test!("cases_can_override_default_assert_macros_partial") +} diff --git a/tests/snapshots/rust-1.49.0/acceptance__cases_can_override_default_assert_macros.snap b/tests/snapshots/rust-1.49.0/acceptance__cases_can_override_default_assert_macros.snap new file mode 100644 index 0000000..d2f788c --- /dev/null +++ b/tests/snapshots/rust-1.49.0/acceptance__cases_can_override_default_assert_macros.snap @@ -0,0 +1,22 @@ +--- +source: tests/acceptance_tests.rs +assertion_line: 148 +expression: output +--- + test::_1_expects_2 + test_2::_1_expects_complex_eq_2 + left: `2`, + right: `1`', src/lib.rs:20:1 +---- test::_1_expects_2 stdout ---- +---- test_2::_1_expects_complex_eq_2 stdout ---- +error: test failed, to rerun pass '--lib' +failures: +failures: +running 4 tests +test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out +test test::_1_expects_1 ... ok +test test::_1_expects_2 ... FAILED +test test_2::_1_expects_complex_eq_1 ... ok +test test_2::_1_expects_complex_eq_2 ... FAILED +thread 'test::_1_expects_2' panicked at 'custom assertion failed: `(left == right)` +thread 'test_2::_1_expects_complex_eq_2' panicked at 'assertion failed: _result == 2', src/lib.rs:26:1 diff --git a/tests/snapshots/rust-1.49.0/acceptance__cases_can_override_default_assert_macros_partial.snap b/tests/snapshots/rust-1.49.0/acceptance__cases_can_override_default_assert_macros_partial.snap new file mode 100644 index 0000000..d33ad37 --- /dev/null +++ b/tests/snapshots/rust-1.49.0/acceptance__cases_can_override_default_assert_macros_partial.snap @@ -0,0 +1,22 @@ +--- +source: tests/acceptance_tests.rs +assertion_line: 153 +expression: output +--- + test::_1_expects_2 + test_2::_1_expects_complex_eq_2 + left: `2`, + right: `1`', src/lib.rs:8:1 +---- test::_1_expects_2 stdout ---- +---- test_2::_1_expects_complex_eq_2 stdout ---- +error: test failed, to rerun pass '--lib' +failures: +failures: +running 4 tests +test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out +test test::_1_expects_1 ... ok +test test::_1_expects_2 ... FAILED +test test_2::_1_expects_complex_eq_1 ... ok +test test_2::_1_expects_complex_eq_2 ... FAILED +thread 'test::_1_expects_2' panicked at 'assertion failed: `(left == right)` +thread 'test_2::_1_expects_complex_eq_2' panicked at 'assertion failed: _result == 2', src/lib.rs:14:1 diff --git a/tests/snapshots/rust-nightly/acceptance__cases_can_override_default_assert_macros.snap b/tests/snapshots/rust-nightly/acceptance__cases_can_override_default_assert_macros.snap new file mode 100644 index 0000000..62e1bb7 --- /dev/null +++ b/tests/snapshots/rust-nightly/acceptance__cases_can_override_default_assert_macros.snap @@ -0,0 +1,22 @@ +--- +source: tests/acceptance_tests.rs +assertion_line: 148 +expression: output +--- + test::_1_expects_2 + test_2::_1_expects_complex_eq_2 + left: `2`, + right: `1`', src/lib.rs:20:1 +---- test::_1_expects_2 stdout ---- +---- test_2::_1_expects_complex_eq_2 stdout ---- +error: test failed, to rerun pass `--lib` +failures: +failures: +running 4 tests +test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s +test test::_1_expects_1 ... ok +test test::_1_expects_2 ... FAILED +test test_2::_1_expects_complex_eq_1 ... ok +test test_2::_1_expects_complex_eq_2 ... FAILED +thread 'test::_1_expects_2' panicked at 'custom assertion failed: `(left == right)` +thread 'test_2::_1_expects_complex_eq_2' panicked at 'assertion failed: _result == 2', src/lib.rs:26:1 diff --git a/tests/snapshots/rust-nightly/acceptance__cases_can_override_default_assert_macros_partial.snap b/tests/snapshots/rust-nightly/acceptance__cases_can_override_default_assert_macros_partial.snap new file mode 100644 index 0000000..fdc85de --- /dev/null +++ b/tests/snapshots/rust-nightly/acceptance__cases_can_override_default_assert_macros_partial.snap @@ -0,0 +1,22 @@ +--- +source: tests/acceptance_tests.rs +assertion_line: 153 +expression: output +--- + test::_1_expects_2 + test_2::_1_expects_complex_eq_2 + left: `2`, + right: `1`', src/lib.rs:8:1 +---- test::_1_expects_2 stdout ---- +---- test_2::_1_expects_complex_eq_2 stdout ---- +error: test failed, to rerun pass `--lib` +failures: +failures: +running 4 tests +test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s +test test::_1_expects_1 ... ok +test test::_1_expects_2 ... FAILED +test test_2::_1_expects_complex_eq_1 ... ok +test test_2::_1_expects_complex_eq_2 ... FAILED +thread 'test::_1_expects_2' panicked at 'assertion failed: `(left == right)` +thread 'test_2::_1_expects_complex_eq_2' panicked at 'assertion failed: _result == 2', src/lib.rs:14:1 diff --git a/tests/snapshots/rust-nightly/acceptance__cases_can_return_result.snap b/tests/snapshots/rust-nightly/acceptance__cases_can_return_result.snap index 4882820..7ff32f9 100644 --- a/tests/snapshots/rust-nightly/acceptance__cases_can_return_result.snap +++ b/tests/snapshots/rust-nightly/acceptance__cases_can_return_result.snap @@ -5,8 +5,6 @@ expression: output --- is_even::_13_expects is_odd_boxed::_12_expects - left: `1`, - left: `1`, ---- is_even::_13_expects stdout ---- ---- is_odd_boxed::_12_expects stdout ---- Error: "is even" @@ -23,5 +21,3 @@ test is_odd_boxed::_13_expects ... ok test panics_supported::_12_expects_panicking_none - should panic ... ok test panics_supported::_13_expects_panicking_some_with_text_ - should panic ... ok test result: FAILED. 4 passed; 2 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s -thread 'is_even::_13_expects' panicked at 'assertion failed: `(left == right)` -thread 'is_odd_boxed::_12_expects' panicked at 'assertion failed: `(left == right)` diff --git a/tests/snapshots/rust-stable/acceptance__cases_can_be_declared_on_non_test_items.snap b/tests/snapshots/rust-stable/acceptance__cases_can_be_declared_on_non_test_items.snap index 88e1c39..02edc37 100644 --- a/tests/snapshots/rust-stable/acceptance__cases_can_be_declared_on_non_test_items.snap +++ b/tests/snapshots/rust-stable/acceptance__cases_can_be_declared_on_non_test_items.snap @@ -7,7 +7,7 @@ expression: output left: `6`, right: `0`', src/lib.rs:8:1 ---- internal_tested_function1::_3_expects_6 stdout ---- -error: test failed, to rerun pass '--lib' +error: test failed, to rerun pass `--lib` failures: failures: running 6 tests diff --git a/tests/snapshots/rust-stable/acceptance__cases_can_override_default_assert_macros.snap b/tests/snapshots/rust-stable/acceptance__cases_can_override_default_assert_macros.snap new file mode 100644 index 0000000..62e1bb7 --- /dev/null +++ b/tests/snapshots/rust-stable/acceptance__cases_can_override_default_assert_macros.snap @@ -0,0 +1,22 @@ +--- +source: tests/acceptance_tests.rs +assertion_line: 148 +expression: output +--- + test::_1_expects_2 + test_2::_1_expects_complex_eq_2 + left: `2`, + right: `1`', src/lib.rs:20:1 +---- test::_1_expects_2 stdout ---- +---- test_2::_1_expects_complex_eq_2 stdout ---- +error: test failed, to rerun pass `--lib` +failures: +failures: +running 4 tests +test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s +test test::_1_expects_1 ... ok +test test::_1_expects_2 ... FAILED +test test_2::_1_expects_complex_eq_1 ... ok +test test_2::_1_expects_complex_eq_2 ... FAILED +thread 'test::_1_expects_2' panicked at 'custom assertion failed: `(left == right)` +thread 'test_2::_1_expects_complex_eq_2' panicked at 'assertion failed: _result == 2', src/lib.rs:26:1 diff --git a/tests/snapshots/rust-stable/acceptance__cases_can_override_default_assert_macros_partial.snap b/tests/snapshots/rust-stable/acceptance__cases_can_override_default_assert_macros_partial.snap new file mode 100644 index 0000000..fdc85de --- /dev/null +++ b/tests/snapshots/rust-stable/acceptance__cases_can_override_default_assert_macros_partial.snap @@ -0,0 +1,22 @@ +--- +source: tests/acceptance_tests.rs +assertion_line: 153 +expression: output +--- + test::_1_expects_2 + test_2::_1_expects_complex_eq_2 + left: `2`, + right: `1`', src/lib.rs:8:1 +---- test::_1_expects_2 stdout ---- +---- test_2::_1_expects_complex_eq_2 stdout ---- +error: test failed, to rerun pass `--lib` +failures: +failures: +running 4 tests +test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s +test test::_1_expects_1 ... ok +test test::_1_expects_2 ... FAILED +test test_2::_1_expects_complex_eq_1 ... ok +test test_2::_1_expects_complex_eq_2 ... FAILED +thread 'test::_1_expects_2' panicked at 'assertion failed: `(left == right)` +thread 'test_2::_1_expects_complex_eq_2' panicked at 'assertion failed: _result == 2', src/lib.rs:14:1 diff --git a/tests/snapshots/rust-stable/acceptance__cases_can_panic.snap b/tests/snapshots/rust-stable/acceptance__cases_can_panic.snap index 3ae7fbb..b1f50ab 100644 --- a/tests/snapshots/rust-stable/acceptance__cases_can_panic.snap +++ b/tests/snapshots/rust-stable/acceptance__cases_can_panic.snap @@ -7,7 +7,7 @@ expression: output panicing::_expects_panicking_some_this_should_fail_ expected substring: `"This should fail"` ---- panicing::_expects_panicking_some_this_should_fail_ stdout ---- -error: test failed, to rerun pass '--lib' +error: test failed, to rerun pass `--lib` failures: failures: running 5 tests diff --git a/tests/snapshots/rust-stable/acceptance__cases_can_return_result.snap b/tests/snapshots/rust-stable/acceptance__cases_can_return_result.snap index 9495091..4882820 100644 --- a/tests/snapshots/rust-stable/acceptance__cases_can_return_result.snap +++ b/tests/snapshots/rust-stable/acceptance__cases_can_return_result.snap @@ -11,7 +11,7 @@ expression: output ---- is_odd_boxed::_12_expects stdout ---- Error: "is even" Error: "is odd" -error: test failed, to rerun pass '--lib' +error: test failed, to rerun pass `--lib` failures: failures: running 7 tests diff --git a/tests/snapshots/rust-stable/acceptance__cases_can_use_regex.snap b/tests/snapshots/rust-stable/acceptance__cases_can_use_regex.snap index c33d737..5adabe1 100644 --- a/tests/snapshots/rust-stable/acceptance__cases_can_use_regex.snap +++ b/tests/snapshots/rust-stable/acceptance__cases_can_use_regex.snap @@ -13,7 +13,7 @@ expression: output ---- regex_test::_kumkwat_expects_complex_regex_r_ stdout ---- ---- regex_test::_kumkwat_expects_complex_regex_r_abc_ stdout ---- error: incomplete escape sequence, reached end of pattern prematurely -error: test failed, to rerun pass '--lib' +error: test failed, to rerun pass `--lib` failures: failures: regex parse error: diff --git a/tests/snapshots/rust-stable/acceptance__cases_support_complex_assertions.snap b/tests/snapshots/rust-stable/acceptance__cases_support_complex_assertions.snap index d31808a..9caea52 100644 --- a/tests/snapshots/rust-stable/acceptance__cases_support_complex_assertions.snap +++ b/tests/snapshots/rust-stable/acceptance__cases_support_complex_assertions.snap @@ -5,7 +5,7 @@ expression: output --- empty::vec_0_expects_complex_empty ---- empty::vec_0_expects_complex_empty stdout ---- -error: test failed, to rerun pass '--lib' +error: test failed, to rerun pass `--lib` failures: failures: running 54 tests diff --git a/tests/snapshots/rust-stable/acceptance__cases_support_pattern_matching.snap b/tests/snapshots/rust-stable/acceptance__cases_support_pattern_matching.snap index d24c169..725feaf 100644 --- a/tests/snapshots/rust-stable/acceptance__cases_support_pattern_matching.snap +++ b/tests/snapshots/rust-stable/acceptance__cases_support_pattern_matching.snap @@ -7,7 +7,7 @@ expression: output extended_pattern_matching_result::ok_should_fail ---- extended_pattern_matching_result::err_should_fail stdout ---- ---- extended_pattern_matching_result::ok_should_fail stdout ---- -error: test failed, to rerun pass '--lib' +error: test failed, to rerun pass `--lib` failures: failures: running 5 tests