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"
|
||||
|
||||
@@ -19,8 +19,7 @@ feature -- Test routines
|
||||
note
|
||||
testing: "url-encoded"
|
||||
do
|
||||
-- test_utf8_decoding ("summer=<3D>t<EFBFBD>&weird=<3D>", "summer=<3D>t<EFBFBD>&weird=<EFBFBD>")
|
||||
test_utf8_decoding ("%%C3%%A9t%%C3%%A9", "<22>t<EFBFBD>")
|
||||
test_utf8_decoding ("%%C3%%A9t%%C3%%A9", {STRING_32}"<22>t<EFBFBD>")
|
||||
end
|
||||
|
||||
test_utf8_decoding (s: STRING_8; e: STRING_32)
|
||||
|
||||
18
library/text/encoder/tests/tests-safe.ecf
Normal file
18
library/text/encoder/tests/tests-safe.ecf
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<system xmlns="http://www.eiffel.com/developers/xml/configuration-1-9-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-9-0 http://www.eiffel.com/developers/xml/configuration-1-9-0.xsd" name="encoder_tests" uuid="C6F56AE3-8E9C-4568-85CA-CA5F1EF15DCE">
|
||||
<target name="encoder_tests">
|
||||
<root class="ANY" feature="default_create"/>
|
||||
<file_rule>
|
||||
<exclude>/.git$</exclude>
|
||||
<exclude>/EIFGENs$</exclude>
|
||||
<exclude>/.svn$</exclude>
|
||||
</file_rule>
|
||||
<option warning="true" full_class_checking="true" is_attached_by_default="true" void_safety="all" syntax="transitional">
|
||||
<assertions precondition="true"/>
|
||||
</option>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="encoder" location="../encoder-safe.ecf" readonly="false"/>
|
||||
<library name="testing" location="$ISE_LIBRARY\library\testing\testing-safe.ecf"/>
|
||||
<tests name="tests" location="."/>
|
||||
</target>
|
||||
</system>
|
||||
Reference in New Issue
Block a user