diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2018-10-24 13:39:51 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2018-10-24 13:39:51 -0700 |
commit | 557fbb3826268909eef3c177853d38e72eb140ab (patch) | |
tree | b51d35f33bd3366a343bf4cf6e6bc15f8bbc56d5 | |
parent | c94c7f3f8eef94b381e6e0e30ab58e7290594193 (diff) |
Uri: add unit test for ClearQuery
-rw-r--r-- | test/src/UriTests.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/src/UriTests.cpp b/test/src/UriTests.cpp index a57dea1..637bfb7 100644 --- a/test/src/UriTests.cpp +++ b/test/src/UriTests.cpp @@ -898,3 +898,11 @@ TEST(UriTests, AssignACopy) { EXPECT_EQ("http://www.example.com/foo.txt?bar", uri1.GenerateString()); EXPECT_EQ("http://example.com/foo.txt#page2", uri2.GenerateString()); } + +TEST(UriTests, ClearQuery) { + Uri::Uri uri; + (void)uri.ParseFromString("http://www.example.com/?foo=bar"); + uri.ClearQuery(); + EXPECT_EQ("http://www.example.com/", uri.GenerateString()); + EXPECT_FALSE(uri.HasQuery()); +} |