Bug 8643: Fix IsMarcStructureInternal tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2020-02-11 16:44:07 +01:00 committed by Martin Renvoize
parent fb69268862
commit a6b359ccbb
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
2 changed files with 4 additions and 3 deletions

View File

@ -824,7 +824,7 @@ sub GetISBDView {
# Process subfield
}
GetMarcStructure creates keys (lib, tab, mandatory, repeatable) for a display purpose.
GetMarcStructure creates keys (lib, tab, mandatory, repeatable, important) for a display purpose.
These different values should not be processed as valid subfields.
=cut

View File

@ -554,7 +554,7 @@ subtest 'NORMARC' => sub {
};
subtest 'IsMarcStructureInternal' => sub {
plan tests => 8;
plan tests => 9;
my $tagslib = GetMarcStructure();
my @internals;
for my $tag ( sort keys %$tagslib ) {
@ -564,11 +564,12 @@ subtest 'IsMarcStructureInternal' => sub {
}
}
@internals = uniq @internals;
is( scalar(@internals), 6, 'expect 6 internals');
is( scalar(@internals), 7, 'expect 7 internals');
is( grep( /^lib$/, @internals ), 1, 'check lib' );
is( grep( /^tab$/, @internals ), 1, 'check tab' );
is( grep( /^mandatory$/, @internals ), 1, 'check mandatory' );
is( grep( /^repeatable$/, @internals ), 1, 'check repeatable' );
is( grep( /^important$/, @internals ), 1, 'check important' );
is( grep( /^a$/, @internals ), 0, 'no subfield a' );
is( grep( /^ind1_defaultvalue$/, @internals ), 1, 'check indicator 1 default value' );
is( grep( /^ind2_defaultvalue$/, @internals ), 1, 'check indicator 2 default value' );