Bug 9859: Follow-up - Adding a simple unit test for nsb_clean
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Thu, 16 Oct 2014 14:10:50 +0000 (11:10 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 22 Oct 2014 17:06:21 +0000 (14:06 -0300)
This tests uses the example given on the perl file on the
bug report.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
t/Charset.t

index 27b2a32..cd0dc1e 100755 (executable)
 
 use Modern::Perl;
 
-use Test::More tests => 10;
+use Test::More tests => 11;
 use MARC::Record;
 
+use utf8;
+use open ':std', ':encoding(utf8)';
+
 BEGIN {
     use_ok('C4::Charset');
 }
@@ -55,4 +58,6 @@ ok( utf8::is_utf8($record->subfield('100','a')) &&
     utf8::is_utf8($record->subfield('245','a')),
     'SetUTF8Flag sets the UTF-8 flag to all subfields' );
 
+is( nsb_clean("\98Le\9c Moyen Âge"), "Le Moyen Âge", "nsb_clean removes \98 and \9c" );
+
 1;