Skip to content

Add possibility to replace assert_eq! with custom assertion #31

@frondeus

Description

@frondeus

When using => expected syntax it could be nice to set up what assertion shall we use.
It might be extra attribute:

#[test_case("foo" => "bar")]
#[test_case_assert_macro(assert_diff)]
fn test(input: &str) -> String { input.to_string() }

this could be expanded into:

mod test {
    use super::*;
    fn test(input: &str) -> String { input.to_string() }
    
    #[test]
    fn foo_expects_bar() {
       let actual = test("foo");
       assert_diff!("bar", actual);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions