Bugzilla – Attachment 24307 Details for
Bug 11540
Increasing test coverage for C4::Charset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11540: (folowup) add a couple of tests more
Bug-11540-folowup-add-a-couple-of-tests-more.patch (text/plain), 2.42 KB, created by
Emma Heath
on 2014-01-14 20:19:33 UTC
(
hide
)
Description:
Bug 11540: (folowup) add a couple of tests more
Filename:
MIME Type:
Creator:
Emma Heath
Created:
2014-01-14 20:19:33 UTC
Size:
2.42 KB
patch
obsolete
>From 8bfee003090bfa9e7f888642ee9b2aac5691627a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Tue, 14 Jan 2014 11:35:31 -0300 >Subject: [PATCH] Bug 11540: (folowup) add a couple of tests more > >This patch makes sure all scenarios are covered for SetUTF8Flag. > >Regards >To+ > >Signed-off-by: Emma Heath <emmaheath.student@wegc.school.nz> >--- > t/Charset.t | 44 ++++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 40 insertions(+), 4 deletions(-) > >diff --git a/t/Charset.t b/t/Charset.t >index 8debbd7..27b2a32 100755 >--- a/t/Charset.t >+++ b/t/Charset.t >@@ -1,9 +1,25 @@ > #!/usr/bin/perl > >-use strict; >-use warnings; >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 10; >+use MARC::Record; > >-use Test::More tests => 7; > BEGIN { > use_ok('C4::Charset'); > } >@@ -19,4 +35,24 @@ ok(!utf8::is_utf8($octets), "verify that IsStringUTF8ish does not magically turn > $octets = "a\xc2" . "c"; > ok(!IsStringUTF8ish($octets), "verify octets are not valid UTF-8"); > >-ok(!SetUTF8Flag(), 'Testing SetUTF8Flag' ); >+ok( !SetUTF8Flag(), 'SetUTF8Flag returns undef if no record passed' ); >+ >+my $record = MARC::Record->new(); >+ok( !SetUTF8Flag($record), 'SetUTF8Flag returns undef if the record has no subfields' ); >+# Add some fields/subfields >+$record->append_fields( >+ MARC::Field->new('100', ' ', ' ', a => 'Julio Cortazar'), >+ MARC::Field->new('245', ' ', ' ', a => 'Rayuela'), >+); >+# Verify our data serves its purpose >+ok( !utf8::is_utf8($record->subfield('100','a')) && >+ !utf8::is_utf8($record->subfield('245','a')), >+ 'Verify that the subfields are NOT set the UTF-8 flag yet' ); >+ >+SetUTF8Flag($record); >+ >+ok( utf8::is_utf8($record->subfield('100','a')) && >+ utf8::is_utf8($record->subfield('245','a')), >+ 'SetUTF8Flag sets the UTF-8 flag to all subfields' ); >+ >+1; >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11540
:
24251
|
24263
|
24266
|
24285
|
24286
|
24304
|
24307
|
24316
|
24317