Commit 7cbed637 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[2498] Add a few quoting tests for toText() in HINFO and NAPTR

parent a3e0f04e
......@@ -102,6 +102,11 @@ TEST_F(Rdata_HINFO_Test, createFromLexer) {
TEST_F(Rdata_HINFO_Test, toText) {
HINFO hinfo(hinfo_str);
EXPECT_EQ(hinfo_str, hinfo.toText());
// will add quotes even if they were not in the original input
EXPECT_EQ("\"a\" \"b\"", HINFO("a b").toText());
// will not add additional quotes
EXPECT_EQ("\"a\" \"b\"", HINFO("\"a\" \"b\"").toText());
}
TEST_F(Rdata_HINFO_Test, toWire) {
......
......@@ -183,6 +183,14 @@ TEST_F(Rdata_NAPTR_Test, toWireRenderer) {
TEST_F(Rdata_NAPTR_Test, toText) {
NAPTR naptr(naptr_str);
EXPECT_EQ(naptr_str, naptr.toText());
// will add quotes even if they were not in the original input
EXPECT_EQ("10 100 \"S\" \"SIP+D2U\" \".*\" _sip._udp.example.com.",
NAPTR("10 100 S SIP+D2U .* _sip._udp.example.com.").toText());
// will not add additional quotes
EXPECT_EQ("10 100 \"S\" \"SIP+D2U\" \".*\" _sip._udp.example.com.",
NAPTR("10 100 \"S\" \"SIP+D2U\" \".*\" _sip._udp.example.com.")
.toText());
}
TEST_F(Rdata_NAPTR_Test, compare) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment