From 19d48dd349bfdd869dec573ca50ccbf11818cd74 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 21 Apr 2016 11:37:48 -0400 Subject: [PATCH] tests: Added ISO8859-1 codec test Signed-off-by: Lucas Bajolet --- tests/sav/test_iso88591_codec.res | 2 ++ tests/test_iso88591_codec.nit | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/sav/test_iso88591_codec.res create mode 100644 tests/test_iso88591_codec.nit diff --git a/tests/sav/test_iso88591_codec.res b/tests/sav/test_iso88591_codec.res new file mode 100644 index 0000000..56803be --- /dev/null +++ b/tests/sav/test_iso88591_codec.res @@ -0,0 +1,2 @@ +éçaIS1623CEDjdEF +��aIS1623CEDjdEF diff --git a/tests/test_iso88591_codec.nit b/tests/test_iso88591_codec.nit new file mode 100644 index 0000000..b4f76fc --- /dev/null +++ b/tests/test_iso88591_codec.nit @@ -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 -- 1.7.9.5