frondeus / test-case

Rust procedural macro attribute for adding test cases easily
MIT License
614 stars 39 forks source link

Add `it (not) matches_regex ...` #80

Closed luke-biel closed 2 years ago

luke-biel commented 2 years ago

As an user of test case I want to be able to test whether actual value matches giver regular expression within complex assertions, eg.:

#[test_case("1" => it matches_regex "[0-9]")]
fn test_this(s: &str) -> &str {
    s
}

This feature has to be hidden behind feature flag (regex) and require user to manually import https://docs.rs/regex/latest/regex/ crate