Files
EWF/library/text/encoder/tests/test_url_encoder.e
Jocelyn Fiat fb7854fbcc Added visitor patterns to WSF_VALUE
Handling UTF-8 unencoding for WSF_VALUE ...
Added WSF_TABLE_VALUE to handle list[]=a&list[]=b ...

Library encoder: added UTF8 facilities
2011-10-24 17:23:36 +02:00

64 lines
1.4 KiB
Plaintext

note
description: "[
Eiffel tests that can be executed by testing tool.
]"
author: "EiffelStudio test wizard"
date: "$Date$"
revision: "$Revision$"
testing: "type/manual"
class
TEST_URL_ENCODER
inherit
EQA_TEST_SET
feature -- Test routines
test_url_encoded_encoder
note
testing: "url-encoded"
do
test_url_encoded_encoding ("http://domain.tld/foo/bar/script.php?test='toto'&foo=bar&title=il était une fois")
test_url_encoded_encoding ("été")
test_url_encoded_decoding ("%%E9t%%E9", "été")
test_url_encoded_decoding ("%%C3%%A9t%%C3%%A9", "été")
end
test_url_encoded_encoding (s: STRING_32)
local
u: STRING_32
e: STRING_8
b: URL_ENCODER
do
create b
e := b.encoded_string (s)
u := b.decoded_string (e)
assert ("decoded encoded string is same for string %"" + u + "%"", u ~ s)
end
test_url_encoded_decoding (s: STRING_8; e: STRING_32)
local
u: STRING_32
b: 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"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end