summaryrefslogtreecommitdiff
path: root/test/ares-test-misc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/ares-test-misc.cc')
-rw-r--r--test/ares-test-misc.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ares-test-misc.cc b/test/ares-test-misc.cc
index bde4678..5e5bc0b 100644
--- a/test/ares-test-misc.cc
+++ b/test/ares-test-misc.cc
@@ -193,6 +193,19 @@ TEST_F(LibraryTest, CreateQuery) {
EXPECT_EQ(expected, actual);
}
+TEST_F(LibraryTest, CreateQueryTrailingEscapedDot) {
+ byte* p;
+ int len;
+ EXPECT_EQ(ARES_SUCCESS,
+ ares_create_query("example.com\\.", ns_c_in, ns_t_a, 0x1234, 0,
+ &p, &len, 0));
+ std::vector<byte> data(p, p + len);
+ ares_free_string(p);
+
+ std::string actual = PacketToString(data);
+ EXPECT_EQ("REQ QRY Q:{'example.com\\.' IN A}", actual);
+}
+
TEST_F(LibraryTest, CreateQueryFailures) {
byte* p;
int len;