pike.git
/
src
/
modules
/
_Roxen
/
testsuite.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/_Roxen/testsuite.in:2:
test_eq(_Roxen.html_encode_string (0), "0") test_eq(_Roxen.html_encode_string (""), "") test_eq(_Roxen.html_encode_string (10), "10") test_eq(_Roxen.html_encode_string("a&b<c>d"), "a&b<c>d") test_eq(_Roxen.http_decode_string(""), "") test_eq(_Roxen.http_decode_string("abc+d%20e%41"), "abc+d eA") test_eq(_Roxen.http_decode_string(""), "") test_eq(_Roxen.http_decode_string("+"), "+")
-
test_
do
(_Roxen.http_decode_string("%"))
-
test_
do
(_Roxen.http_decode_string("%0"))
-
test_
do
(_Roxen.http_decode_string("%%"))
-
test_
do
(_Roxen.http_decode_string("%%%"))
-
test_
do
(_Roxen.http_decode_string("%41%"))
-
test_
do
(_Roxen.http_decode_string("%41%0"))
-
test_
do
(_Roxen.http_decode_string("%41%%"))
-
test_
do
(_Roxen.http_decode_string("%41%%%"))
-
test_
do
(_Roxen.http_decode_string("%u"))
-
test_
do
(_Roxen.http_decode_string("%u0"))
-
test_
do
(_Roxen.http_decode_string("%u00"))
-
test_
do
(_Roxen.http_decode_string("%u000"))
-
test_
do
(_Roxen.http_decode_string("%u000_"))
-
test_
do
(_Roxen.http_decode_string("%41%u"))
-
test_
do
(_Roxen.http_decode_string("%41%u0"))
-
test_
do
(_Roxen.http_decode_string("%41%u00"))
-
test_
do
(_Roxen.http_decode_string("%41%u000"))
-
test_
do
(_Roxen.http_decode_string("%41%u000_"))
+
+
// The following inputs are all illegal, but are allowed
+
// for compat reasons.
+
test_
eq
(_Roxen.http_decode_string("%")
, "\0"
)
+
test_
eq
(_Roxen.http_decode_string("%0")
, "\0"
)
+
test_
eq
(_Roxen.http_decode_string("%%")
, "\0"
)
+
test_
eq
(_Roxen.http_decode_string("%%%")
, "U"
)
+
test_
eq
(_Roxen.http_decode_string("%41%")
, "A\0"
)
+
test_
eq
(_Roxen.http_decode_string("%41%0")
, "A\0"
)
+
test_
eq
(_Roxen.http_decode_string("%41%%")
, "A\0"
)
+
test_
eq
(_Roxen.http_decode_string("%41%%%")
, "AU"
)
+
test_
eq
(_Roxen.http_decode_string("%u")
, "\0"
)
+
test_
eq
(_Roxen.http_decode_string("%u0")
, "\0"
)
+
test_
eq
(_Roxen.http_decode_string("%u00")
, "\0"
)
+
test_
eq
(_Roxen.http_decode_string("%u000")
, "\0"
)
+
test_
eq
(_Roxen.http_decode_string("%u000_")
, "\b"
)
+
test_
eq
(_Roxen.http_decode_string("%41%u")
, "A\0"
)
+
test_
eq
(_Roxen.http_decode_string("%41%u0")
, "A\0"
)
+
test_
eq
(_Roxen.http_decode_string("%41%u00")
, "A\0"
)
+
test_
eq
(_Roxen.http_decode_string("%41%u000")
, "A\0"
)
+
test_
eq
(_Roxen.http_decode_string("%41%u000_")
, "A\b"
)
+
test_eq(_Roxen.http_decode_string("%u12345"), "\x1234""5") test_eq(_Roxen.http_decode_string("%U12345"), "\x1234""5") define(test_mkhttp,[[ test_any_equal([[ string x=_Roxen.make_http_headers($1); if(!has_suffix(x, "\r\n")) return -1; return sort(x/"\r\n"-({""})); ]],$2) ]])