diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2018-06-30 20:55:44 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2018-06-30 20:55:44 -0700 |
commit | 58e2beb7717cf724ae37e03f2e5bf3afbfc23a35 (patch) | |
tree | 6d56372959fb135e1f37717d9e9ffcb24658efd7 /test | |
parent | a84a28c61ff44f714edf31e77500d796e3bd4ce4 (diff) |
Uri: fix mistakes from last session
* Parts of a path are called "segments", not "steps",
in the RFC.
* The RFC specifies that path separators are always
forward slashes, so don't support other separators.
Diffstat (limited to 'test')
-rw-r--r-- | test/src/UriTests.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/test/src/UriTests.cpp b/test/src/UriTests.cpp index 73848a9..2f8f28e 100644 --- a/test/src/UriTests.cpp +++ b/test/src/UriTests.cpp @@ -38,38 +38,6 @@ TEST(UriTests, ParseFromStringUrnDefaultPathDelimiter) { ); } -TEST(UriTests, ParseFromStringUrnSingleCharacterPathDelimiter) { - Uri::Uri uri; - uri.SetPathDelimiter(":"); - ASSERT_TRUE(uri.ParseFromString("urn:book:fantasy:Hobbit")); - ASSERT_EQ("urn", uri.GetScheme()); - ASSERT_EQ("", uri.GetHost()); - ASSERT_EQ( - (std::vector< std::string >{ - "book", - "fantasy", - "Hobbit", - }), - uri.GetPath() - ); -} - -TEST(UriTests, ParseFromStringUrnMultiCharacterPathDelimiter) { - Uri::Uri uri; - uri.SetPathDelimiter("/-"); - ASSERT_TRUE(uri.ParseFromString("urn:bo-/ok/-fant/asy/-Hob-bit")); - ASSERT_EQ("urn", uri.GetScheme()); - ASSERT_EQ("", uri.GetHost()); - ASSERT_EQ( - (std::vector< std::string >{ - "bo-/ok", - "fant/asy", - "Hob-bit", - }), - uri.GetPath() - ); -} - TEST(UriTests, ParseFromStringPathCornerCases) { struct TestVector { std::string pathIn; |