From b2ce128daa829682dabaedac740a8a41d45af259 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Tue, 28 Nov 2023 08:59:32 -0500 Subject: [PATCH] regex: add more tests --- src/regex.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/regex.rs b/src/regex.rs index cc6c3b5f..7866a171 100644 --- a/src/regex.rs +++ b/src/regex.rs @@ -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())); }