From d475ebc610dfceb11cd34125b5a06c7f530f0ea6 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 24 Oct 2013 17:44:00 -0400 Subject: [PATCH] Test Perl Unicode normalization process Add some basic tests of our Unicode normalization (and entityization) process. Also, 'use utf8;' tells the script that it contains UTF8 characters, not binary bytes, and resolves a test problem. Signed-off-by: Dan Wells Signed-off-by: Dan Scott --- Open-ILS/src/perlmods/t/01-OpenILS-Application.t | 1 + Open-ILS/src/perlmods/t/14-OpenILS-Utils.t | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/t/01-OpenILS-Application.t b/Open-ILS/src/perlmods/t/01-OpenILS-Application.t index a4367f6ca9..6b30fbbe80 100644 --- a/Open-ILS/src/perlmods/t/01-OpenILS-Application.t +++ b/Open-ILS/src/perlmods/t/01-OpenILS-Application.t @@ -1,5 +1,6 @@ #!perl -T +use utf8; use Test::More tests => 14; BEGIN { diff --git a/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t b/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t index 621c98fdfc..c9de2884a0 100644 --- a/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t +++ b/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t @@ -1,7 +1,8 @@ #!perl -T -use Test::More tests => 30; +use Test::More tests => 32; use Test::Warn; +use utf8; use_ok( 'OpenILS::Utils::Configure' ); use_ok( 'OpenILS::Utils::Cronscript' ); @@ -86,6 +87,8 @@ my $exp_xml = '01614nmm a22003975u 4500entityize('èöçÇÈÀ'), 'èöçÇÈÀ', 'entityize: diacritics NFC'); +is(OpenILS::Application::AppUtils->entityize('èöçÇÈÀ', 'D'), 'èöçÇÈÀ', 'entityize: diacritics NFD'); is(OpenILS::Utils::Normalize::clean_marc('èöçÇÈÀ'), 'èöçÇÈÀ', 'clean_marc: diacritics'); my $edi_invoice = "UNA:+.? 'UNB+UNOC:3+1556150:31B+123EVER:31B+120926:1621+4'UNH+11+INVOIC:D:96A:UN'BGM+380+5TST084026+9'DTM+137:20120924:102'RFF+ON:24'NAD+BY+123EVER 0001::91'NAD+SU+1691503::31B'CUX+2:USD:4'LIN+1++9780446360272'QTY+47:5'MOA+146:4.5:USD:10'MOA+203:14.65'PRI+AAF:2.93:DI:NTP'RFF+LI:24/102'LIN+2++9780446357197'QTY+47:8'MOA+146:6.5:USD:10'MOA+203:33.84'PRI+AAF:4.23:DI:NTP'RFF+LI:24/100'UNS+S'MOA+86:66.18'ALC+C++++DL'MOA+8:2'ALC+C++++CA'MOA+131:12.3'ALC+C++++TX'MOA+8:3.39'UNT+28+11'UNH+12+INVOIC:D:96A:UN'BGM+380+5TST084027+9'DTM+137:20120924:102'RFF+ON:26'NAD+BY+123EVER 0001::91'NAD+SU+1691503::31B'CUX+2:USD:4'LIN+1++9780446360272'QTY+47:1'MOA+146:4.5:USD:10'MOA+203:4.05'PRI+AAF:4.05:DI:NTP'RFF+LI:26/106'LIN+2++9780446350105'QTY+47:3'MOA+146:6.99:USD:10'MOA+203:14.67'PRI+AAF:4.89:DI:NTP'RFF+LI:26/105'UNS+S'MOA+86:25.03'ALC+C++++DL'MOA+8:2'ALC+C++++CA'MOA+131:3'ALC+C++++TX'MOA+8:1.31'UNT+28+12'UNZ+4+4'"; -- 2.11.0