Skip to content

Commit

Permalink
#111: Test just one generic
Browse files Browse the repository at this point in the history
  • Loading branch information
la10736 committed Apr 5, 2021
1 parent 4991112 commit 6e3da77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/resources/rstest/convert_string_literal.rs
Expand Up @@ -46,3 +46,10 @@ 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());
}

#[rstest]
#[case("1.2.3.4", "1.2.3.4:42")]
#[case("1.2.3.4".to_owned(), "1.2.3.4:42")]
fn not_convert_generics<S: AsRef<str>>(#[case] ip: S, #[case] addr: SocketAddr) {
assert_eq!(addr.ip().to_string(), ip.as_ref());
}
2 changes: 2 additions & 0 deletions tests/rstest/mod.rs
Expand Up @@ -845,6 +845,8 @@ fn convert_string_literal() {
.fail("values::addr_4")
.ok("not_convert_byte_array::case_1::values_1")
.ok("not_convert_impl::case_1")
.ok("not_convert_generics::case_1")
.ok("not_convert_generics::case_2")
.assert(output);
}

Expand Down

0 comments on commit 6e3da77

Please sign in to comment.