Bugzilla – Attachment 63103 Details for
Bug 18152
UNIMARC bib records imported with invalid 'a' char in label pos.9
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18152: Add tests
Bug-18152-Add-tests.patch (text/plain), 2.10 KB, created by
Jonathan Druart
on 2017-05-04 13:38:20 UTC
(
hide
)
Description:
Bug 18152: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-05-04 13:38:20 UTC
Size:
2.10 KB
patch
obsolete
>From 32efadc5e57b78cf5b1ce184320b3f5d8c1d5475 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 3 May 2017 15:30:14 -0300 >Subject: [PATCH] Bug 18152: Add tests > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/Charset.t | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > >diff --git a/t/Charset.t b/t/Charset.t >index 143c208..fc25a66 100755 >--- a/t/Charset.t >+++ b/t/Charset.t >@@ -17,11 +17,13 @@ > > use Modern::Perl; > >-use Test::More tests => 16; >+use Test::More tests => 17; > use Encode qw( is_utf8 ); > > use MARC::Record; > >+use t::lib::Mocks; >+ > use utf8; > use open ':std', ':encoding(utf8)'; > >@@ -71,4 +73,27 @@ ok( Encode::is_utf8($record->subfield('100','a')) && > > is( nsb_clean("ÂLe Moyen Ãge"), "Le Moyen Ãge", "nsb_clean removes  and Â" ); > >+subtest 'SetMarcUnicodeFlag' => sub { >+ plan tests => 2; >+ # TODO This should be done in MARC::Record >+ my $leader = '012345678X0 '; >+ my $expected_marc21_leader = '012345678a0 '; # position 9 of leader must be 'a' >+ my $expected_unimarc_leader = '012345678X0 '; # position 9 of leader must not be changed >+ # Note that position 9 of leader should be blank for UNIMARC, but as it is not related to encoding >+ # we do not want to change it >+ >+ t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); >+ my $marc21_record = MARC::Record->new; >+ $marc21_record->leader($leader); >+ SetMarcUnicodeFlag( $marc21_record, C4::Context->preference('marcflavour') ); >+ is( $marc21_record->leader, $expected_marc21_leader, 'Leader 9 for MARC21 mush be "a"' ); >+ >+ t::lib::Mocks::mock_preference( 'marcflavour', 'UNIMARC' ); >+ t::lib::Mocks::mock_preference( 'UNIMARCField100Language', 'fre' ); >+ my $unimarc_record = MARC::Record->new; >+ $unimarc_record->leader($leader); >+ SetMarcUnicodeFlag( $unimarc_record, C4::Context->preference('marcflavour') ); >+ is( $unimarc_record->leader, $expected_unimarc_leader, 'Leader 9 for UNIMARC must be blank' ); >+}; >+ > 1; >-- >2.9.3
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 18152
:
60547
|
60548
|
60549
|
60550
|
60551
|
62246
|
63008
|
63040
|
63041
|
63102
| 63103