Skip to content

Commit

Permalink
change test website
Browse files Browse the repository at this point in the history
  • Loading branch information
zuisong committed Sep 11, 2022
1 parent 69e09e0 commit 4dbc8c4
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1199,42 +1199,20 @@ fn cert_without_key() {
#[test]
fn use_ipv4() {
get_command()
.args(&[
"https://v4v6.ipv6-test.com/api/myip.php",
"--body",
"--ipv4",
])
.args(&["https://api64.ipify.org", "--body", "--ipv4"])
.assert()
.stdout(function(|output: &str| {
IpAddr::from_str(output.trim()).unwrap().is_ipv4()
}))
.stderr(predicates::str::is_empty());
}

#[cfg(feature = "online-tests")]
#[test]
fn use_ipv6() {
get_command()
.args(&["https://v4.ipv6-test.com/api/myip.php", "--body", "--ipv4"])
.assert()
.success();

get_command()
.args(&["https://v4.ipv6-test.com/api/myip.php", "--body", "--ipv6"])
.assert()
.failure();
}

// real use ipv6
#[cfg(all(feature = "ipv6-tests", feature = "online-tests"))]
#[test]
fn use_ipv6_real() {
fn use_ipv6() {
get_command()
.args(&[
"https://v4v6.ipv6-test.com/api/myip.php",
"--body",
"--ipv6",
])
.args(&["https://api64.ipify.org", "--body", "--ipv6"])
.assert()
.stdout(function(|output: &str| {
IpAddr::from_str(output.trim()).unwrap().is_ipv6()
Expand Down

0 comments on commit 4dbc8c4

Please sign in to comment.