Better signature for encoders
Split library .ecf and the autotest .ecf
This commit is contained in:
@@ -19,10 +19,11 @@ feature -- Test routines
|
||||
note
|
||||
testing: "url-encoded"
|
||||
do
|
||||
test_url_encoded_encoding ("http://domain.tld/foo/bar/script.php?test='toto'&foo=bar&title=il <20>tait une fois")
|
||||
test_url_encoded_encoding ("<22>t<EFBFBD>")
|
||||
test_url_encoded_decoding ("%%E9t%%E9", "<22>t<EFBFBD>")
|
||||
test_url_encoded_decoding ("%%C3%%A9t%%C3%%A9", "<22>t<EFBFBD>")
|
||||
test_url_encoded_encoding ({STRING_32}"http://domain.tld/foo/bar/script.php?test='toto'&foo=bar&title=il <20>tait une fois")
|
||||
test_url_encoded_encoding ({STRING_32}"<22>t<EFBFBD>")
|
||||
test_url_encoded_decoding ({STRING_8}"%%E9t%%E9", {STRING_32}"<22>t<EFBFBD>")
|
||||
|
||||
test_utf8_url_encoded_decoding ({STRING_8}"%%C3%%A9t%%C3%%A9", {STRING_32}"<22>t<EFBFBD>")
|
||||
end
|
||||
|
||||
test_url_encoded_encoding (s: STRING_32)
|
||||
@@ -47,6 +48,16 @@ feature -- Test routines
|
||||
assert ("decoded encoded string is same for %"" + s + "%"", u ~ e)
|
||||
end
|
||||
|
||||
test_utf8_url_encoded_decoding (s: STRING_8; e: STRING_32)
|
||||
local
|
||||
u: STRING_32
|
||||
b: UTF8_URL_ENCODER
|
||||
do
|
||||
create b
|
||||
u := b.decoded_string (s)
|
||||
assert ("decoded encoded string is same for %"" + s + "%"", u ~ e)
|
||||
end
|
||||
|
||||
|
||||
note
|
||||
copyright: "2011-2011, Eiffel Software and others"
|
||||
|
||||
Reference in New Issue
Block a user