diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/src/UriTests.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/src/UriTests.cpp b/test/src/UriTests.cpp index d246a4d..1724b89 100644 --- a/test/src/UriTests.cpp +++ b/test/src/UriTests.cpp @@ -310,3 +310,20 @@ TEST(UriTests, ParseFromStringUserInfoBarelyLegal) { ++index; } } + +TEST(UriTests, ParseFromStringDontMisinterpretColonInAuthorityAsSchemeDelimiter) { + const std::vector< std::string > testVectors{ + {"//foo:bar@www.example.com/"}, + {"//www.example.com/a:b"}, + {"//www.example.com/foo?a:b"}, + {"//www.example.com/foo#a:b"}, + {"//[v7.:]/"}, + }; + size_t index = 0; + for (const auto& testVector : testVectors) { + Uri::Uri uri; + ASSERT_TRUE(uri.ParseFromString(testVector)) << index; + ASSERT_TRUE(uri.GetScheme().empty()); + ++index; + } +} |