Skip to content

Commit

Permalink
regex: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hinto-janai committed Nov 28, 2023
1 parent 77d0a7e commit b2ce128
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,16 @@ mod test {
assert!(Regex::is_match(&r.address, "44hintoFpuo3ugKfcqJvh5BmrsTRpnTasJmetKC4VXCt6QDtbHVuixdTtsm6Ptp7Y8haXnJ6j8Gj2dra8CKy5ewz7Vi9CYW"));
assert!(Regex::is_match(&r.ipv4, "192.168.1.2"));
assert!(Regex::is_match(&r.ipv4, "127.0.0.1"));
assert!(Regex::is_match(&r.domain, "sub.domain.com"));
assert!(Regex::is_match(&r.domain, "sub.domain.longtld"));
assert!(Regex::is_match(&r.domain, "sub.sub.domain.longtld"));
assert!(Regex::is_match(&r.domain, "my.node.com"));
assert!(Regex::is_match(&r.domain, "my.node.longtld"));
assert!(Regex::is_match(&r.domain, "my.monero-node123.net"));
assert!(Regex::is_match(&r.domain, "www.my-node.org"));
assert!(Regex::is_match(&r.domain, "www.my-monero-node123.io"));
assert!(Regex::is_match(&r.domain, "www.my-monero-node123.longtld"));
assert!(Regex::is_match(&r.domain, "www.my-monero-node123.org"));
for i in 1..=65535 {
assert!(Regex::is_match(&r.port, &i.to_string()));
}
Expand Down

0 comments on commit b2ce128

Please sign in to comment.