Lines 71-74
ok( Encode::is_utf8($record->subfield('100','a')) &&
Link Here
|
71 |
|
71 |
|
72 |
is( nsb_clean("Le Moyen Âge"), "Le Moyen Âge", "nsb_clean removes and " ); |
72 |
is( nsb_clean("Le Moyen Âge"), "Le Moyen Âge", "nsb_clean removes and " ); |
73 |
|
73 |
|
74 |
1; |
74 |
subtest 'SetMarcUnicodeFlag' => sub { |
|
|
75 |
plan tests => 2; |
76 |
# TODO This should be done in MARC::Record |
77 |
my $leader = '012345678X0 '; |
78 |
my $expected_marc21_leader = '012345678a0 '; # position 9 of leader must be 'a' |
79 |
my $expected_unimarc_leader = '012345678X0 '; # position 9 of leader must not be changed |
80 |
# Note that position 9 of leader should be blank for UNIMARC, but as it is not related to encoding |
81 |
# we do not want to change it |
82 |
|
83 |
t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' ); |
84 |
my $marc21_record = MARC::Record->new; |
85 |
$marc21_record->leader($leader); |
86 |
SetMarcUnicodeFlag( $marc21_record, C4::Context->preference('marcflavour') ); |
87 |
is( $marc21_record->leader, $expected_marc21_leader, 'Leader 9 for MARC21 mush be "a"' ); |
88 |
|
89 |
t::lib::Mocks::mock_preference( 'marcflavour', 'UNIMARC' ); |
90 |
t::lib::Mocks::mock_preference( 'UNIMARCField100Language', 'fre' ); |
91 |
my $unimarc_record = MARC::Record->new; |
92 |
$unimarc_record->leader($leader); |
93 |
SetMarcUnicodeFlag( $unimarc_record, C4::Context->preference('marcflavour') ); |
94 |
is( $unimarc_record->leader, $expected_unimarc_leader, 'Leader 9 for UNIMARC must be blank' ); |
95 |
}; |