diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/src/UriTests.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/src/UriTests.cpp b/test/src/UriTests.cpp index 6e93a4e..2e5f2d6 100644 --- a/test/src/UriTests.cpp +++ b/test/src/UriTests.cpp @@ -796,6 +796,13 @@ TEST(UriTests, GenerateString) { {"http", "bob", "", false, 0, {}, true, "foobar", false, "", "http://bob@?foobar"}, {"", "bob", "", false, 0, {}, true, "foobar", false, "", "//bob@?foobar"}, {"", "bob", "", false, 0, {}, false, "", false, "", "//bob@"}, + + // percent-encoded character test vectors + {"http", "b b", "www.example.com", true, 8080, {"", "abc", "def"}, true, "foobar", true, "ch2", "http://b%20b@www.example.com:8080/abc/def?foobar#ch2"}, + {"http", "bob", "www.e ample.com", true, 8080, {"", "abc", "def"}, true, "foobar", true, "ch2", "http://bob@www.e%20ample.com:8080/abc/def?foobar#ch2"}, + {"http", "bob", "www.example.com", true, 8080, {"", "a c", "def"}, true, "foobar", true, "ch2", "http://bob@www.example.com:8080/a%20c/def?foobar#ch2"}, + {"http", "bob", "www.example.com", true, 8080, {"", "abc", "def"}, true, "foo ar", true, "ch2", "http://bob@www.example.com:8080/abc/def?foo%20ar#ch2"}, + {"http", "bob", "www.example.com", true, 8080, {"", "abc", "def"}, true, "foobar", true, "c 2", "http://bob@www.example.com:8080/abc/def?foobar#c%202"}, }; size_t index = 0; for (const auto& testVector : testVectors) { |