Skip to content

Commit

Permalink
Add regexp in test
Browse files Browse the repository at this point in the history
  • Loading branch information
weilence committed Nov 2, 2024
1 parent b73314b commit a329315
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/base/zonefile_fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ mod test {
50,
"a".parse().unwrap(),
"z3950+N2L+N2C".parse().unwrap(),
"".parse().unwrap(),
r#"!^urn:cid:.+@([^\\.]+\\.)(.*)$!\\2!i"#.parse().unwrap(),
Name::from_slice(b"\x09cidserver\x07example\x03com\x00").unwrap(),
));
assert_eq!(
r#"example.com. 3600 IN NAPTR 100 50 "a" "z3950+N2L+N2C" "" cidserver.example.com."#,
r#"example.com. 3600 IN NAPTR 100 50 "a" "z3950+N2L+N2C" "!^urn:cid:.+@([^\\.]+\\.)(.*)$!\\2!i" cidserver.example.com."#,
record.display_zonefile(false).to_string()
);
}
Expand Down
6 changes: 4 additions & 2 deletions src/rdata/naptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,14 @@ mod test {
50,
CharStr::from_octets("a").unwrap(),
CharStr::from_octets("z3950+N2L+N2C").unwrap(),
CharStr::from_octets("").unwrap(),
CharStr::from_octets(r#"!^urn:cid:.+@([^\.]+\.)(.*)$!\2!i"#)
.unwrap(),
Name::<Vec<u8>>::from_str("cidserver.example.com.").unwrap(),
);
assert_eq!(
format!("{}", naptr),
r#"100 50 "a" "z3950+N2L+N2C" "" cidserver.example.com."#
r#"100 50 "a" "z3950+N2L+N2C"
"!^urn:cid:.+@([^\\.]+\\.)(.*)$!\\2!i" cidserver.example.com."#
);
}
}

0 comments on commit a329315

Please sign in to comment.