tests: Added ISO8859-1 codec test
authorLucas Bajolet <r4pass@hotmail.com>
Thu, 21 Apr 2016 15:37:48 +0000 (11:37 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Thu, 21 Apr 2016 18:45:45 +0000 (14:45 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

tests/sav/test_iso88591_codec.res [new file with mode: 0644]
tests/test_iso88591_codec.nit [new file with mode: 0644]

diff --git a/tests/sav/test_iso88591_codec.res b/tests/sav/test_iso88591_codec.res
new file mode 100644 (file)
index 0000000..56803be
--- /dev/null
@@ -0,0 +1,2 @@
+éçaIS1623CEDjdEF
+��aIS1623CEDjdEF
diff --git a/tests/test_iso88591_codec.nit b/tests/test_iso88591_codec.nit
new file mode 100644 (file)
index 0000000..b4f76fc
--- /dev/null
@@ -0,0 +1,25 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+var c = iso88591_codec
+
+var b = c.encode_string("éçaIS1623CEDjdEF")
+
+var str = c.decode_string(b.items, b.length)
+print str
+
+c = utf8_codec
+str = c.decode_string(b.items, b.length)
+
+print str