Skip to content

Commit

Permalink
#111: Tests values conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
la10736 committed Apr 5, 2021
1 parent e1261b3 commit e55f254
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/resources/rstest/convert_string_literal.rs
Expand Up @@ -11,3 +11,16 @@ use std::net::SocketAddr;
fn cases(#[case] expected: bool, #[case] addr: SocketAddr) {
assert_eq!(expected, addr.is_ipv4());
}

#[rstest]
fn values(
#[values(
"1.2.3.4:42",
r#"4.3.2.1:24"#,
"this.is.not.a.socket.address",
r#"this.is.not.a.socket.address"#
)]
addr: SocketAddr,
) {
assert!(addr.is_ipv4())
}
4 changes: 4 additions & 0 deletions tests/rstest/mod.rs
Expand Up @@ -839,6 +839,10 @@ fn convert_string_literal() {
.ok("cases::case_4")
.fail("cases::case_5")
.fail("cases::case_6")
.ok("values::addr_1")
.ok("values::addr_2")
.fail("values::addr_3")
.fail("values::addr_4")
.assert(output);
}

Expand Down

0 comments on commit e55f254

Please sign in to comment.