summaryrefslogtreecommitdiffstats
path: root/net/base/escape_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/base/escape_unittest.cc')
-rw-r--r--net/base/escape_unittest.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/net/base/escape_unittest.cc b/net/base/escape_unittest.cc
index 8c31d41..6601edc 100644
--- a/net/base/escape_unittest.cc
+++ b/net/base/escape_unittest.cc
@@ -107,6 +107,21 @@ TEST(Escape, EscapePath) {
"%7B%7C%7D~%7F%80%FF");
}
+TEST(Escape, EscapeUrl) {
+ ASSERT_EQ(
+ // Most of the character space we care about, un-escaped
+ EscapeUrl(
+ "\x02\n\x1d !\"#$%&'()*+,-./0123456789:;"
+ "<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "[\\]^_`abcdefghijklmnopqrstuvwxyz"
+ "{|}~\x7f\x80\xff"),
+ // Escaped
+ "%02%0A%1D+!%22%23%24%25%26%27()*%2B,-./0123456789:%3B"
+ "%3C%3D%3E%3F%40ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz"
+ "%7B%7C%7D~%7F%80%FF");
+}
+
TEST(Escape, UnescapeURLComponent) {
const UnescapeURLCase unescape_cases[] = {
{"", UnescapeRule::NORMAL, ""},