From c94c7f3f8eef94b381e6e0e30ab58e7290594193 Mon Sep 17 00:00:00 2001
From: Richard Walters <rwalters@digitalstirling.com>
Date: Wed, 24 Oct 2018 13:39:43 -0700
Subject: Uri: fix bugs in copying and comparing URIs with query/fragment parts

Copying query or fragment needs to copy the "hasQuery" and
"hasFragment" flags.

Comparing URIs should make use of "hasQuery" and "hasFragment" to
properly compare URIs that might not have query and/or fragment parts.
---
 test/src/UriTests.cpp | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'test')

diff --git a/test/src/UriTests.cpp b/test/src/UriTests.cpp
index 75693cc..a57dea1 100644
--- a/test/src/UriTests.cpp
+++ b/test/src/UriTests.cpp
@@ -688,6 +688,8 @@ TEST(UriTests, ReferenceResolution) {
         {"http://example.com/", "/foo", "http://example.com/foo"},
         {"http://example.com", "/foo/", "http://example.com/foo/"},
         {"http://example.com/", "/foo/", "http://example.com/foo/"},
+        {"http://example.com/", "?foo", "http://example.com/?foo"},
+        {"http://example.com/", "#foo", "http://example.com/#foo"},
     };
     size_t index = 0;
     for (const auto& testVector : testVectors) {
-- 
cgit v1.2.3