frondeus / test-case

Rust procedural macro attribute for adding test cases easily
MIT License
610 stars 38 forks source link

Add `is (not) len ...` #81

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 for lenght of actual value within complex assertions, eg.:

#[test_case(b"1" => is len 1)]
fn test_this(s: &[u8]) -> &[u8] {
    s
}

This feature can use simple #expr.len() and assume user uses type that supplies len method