Skip to content

Commit

Permalink
#111 Test no impl conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
la10736 committed Apr 5, 2021
1 parent b390fbb commit 4991112
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/resources/rstest/convert_string_literal.rs
Expand Up @@ -31,3 +31,18 @@ fn not_convert_byte_array(#[case] cases: &[u8], #[values(b"abc")] values: &[u8])
assert_eq!(5, cases.len());
assert_eq!(3, values.len());
}

trait MyTrait {
fn my_trait(&self) -> u32 {
42
}
}

impl MyTrait for &str {}

#[rstest]
#[case("impl", "nothing")]
fn not_convert_impl(#[case] that_impl: impl MyTrait, #[case] s: &str) {
assert_eq!(42, that_impl.my_trait());
assert_eq!(42, s.my_trait());
}
1 change: 1 addition & 0 deletions tests/rstest/mod.rs
Expand Up @@ -844,6 +844,7 @@ fn convert_string_literal() {
.fail("values::addr_3")
.fail("values::addr_4")
.ok("not_convert_byte_array::case_1::values_1")
.ok("not_convert_impl::case_1")
.assert(output);
}

Expand Down

0 comments on commit 4991112

Please sign in to comment.