Lines 27-46
BEGIN {
Link Here
|
27 |
} |
27 |
} |
28 |
|
28 |
|
29 |
subtest "MARC21 tests" => sub { |
29 |
subtest "MARC21 tests" => sub { |
30 |
plan tests => 7; |
30 |
plan tests => 9; |
31 |
|
31 |
|
32 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
32 |
t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); |
33 |
|
33 |
|
34 |
ok(C4::Heading::valid_bib_heading_subfield('100', 'a'), '100a valid'); |
34 |
ok(C4::Heading::valid_heading_subfield('100', 'a'), '100a valid for bib'); |
35 |
ok(!C4::Heading::valid_bib_heading_subfield('100', 'e'), '100e not valid'); |
35 |
ok(!C4::Heading::valid_heading_subfield('100', 'e'), '100e not valid for bib'); |
|
|
36 |
|
37 |
ok(C4::Heading::valid_heading_subfield('100', 'a', 1), '100a valid for authority'); |
38 |
ok(!C4::Heading::valid_heading_subfield('100', 'e', 1), '100e not valid for authority'); |
36 |
|
39 |
|
37 |
ok(C4::Heading::valid_bib_heading_subfield('110', 'a'), '110a valid'); |
40 |
ok(C4::Heading::valid_heading_subfield('110', 'a'), '110a valid for bib'); |
38 |
ok(!C4::Heading::valid_bib_heading_subfield('110', 'e'), '110e not valid'); |
41 |
ok(!C4::Heading::valid_heading_subfield('110', 'e'), '110e not valid for bib'); |
39 |
|
42 |
|
40 |
ok(C4::Heading::valid_bib_heading_subfield('600', 'a'), '600a valid'); |
43 |
ok(C4::Heading::valid_heading_subfield('600', 'a'), '600a valid for bib'); |
41 |
ok(!C4::Heading::valid_bib_heading_subfield('600', 'e'), '600e not valid'); |
44 |
ok(!C4::Heading::valid_heading_subfield('600', 'e'), '600e not valid for bib'); |
42 |
|
45 |
|
43 |
ok(!C4::Heading::valid_bib_heading_subfield('012', 'a'), '012a invalid field'); |
46 |
ok(!C4::Heading::valid_heading_subfield('012', 'a'), '012a invalid field for bib'); |
44 |
}; |
47 |
}; |
45 |
|
48 |
|
46 |
subtest "UNIMARC tests" => sub { |
49 |
subtest "UNIMARC tests" => sub { |
Lines 48-61
subtest "UNIMARC tests" => sub {
Link Here
|
48 |
|
51 |
|
49 |
t::lib::Mocks::mock_preference('marcflavour', 'UNIMARC'); |
52 |
t::lib::Mocks::mock_preference('marcflavour', 'UNIMARC'); |
50 |
|
53 |
|
51 |
ok(C4::Heading::valid_bib_heading_subfield('100', 'a'), '100a valid'); |
54 |
ok(C4::Heading::valid_heading_subfield('100', 'a'), '100a valid for bib'); |
52 |
ok(!C4::Heading::valid_bib_heading_subfield('100', 'i'), '100i not valid'); |
55 |
ok(!C4::Heading::valid_heading_subfield('100', 'i'), '100i not valid fir bib'); |
53 |
|
56 |
|
54 |
ok(C4::Heading::valid_bib_heading_subfield('110', 'a'), '110a valid'); |
57 |
ok(C4::Heading::valid_heading_subfield('110', 'a'), '110a valid for bib'); |
55 |
ok(!C4::Heading::valid_bib_heading_subfield('110', 'i'), '110i not valid'); |
58 |
ok(!C4::Heading::valid_heading_subfield('110', 'i'), '110i not valid for bib'); |
56 |
|
59 |
|
57 |
ok(C4::Heading::valid_bib_heading_subfield('600', 'a'), '600a valid'); |
60 |
ok(C4::Heading::valid_heading_subfield('600', 'a'), '600a valid for bib'); |
58 |
ok(!C4::Heading::valid_bib_heading_subfield('600', 'i'), '600i not valid'); |
61 |
ok(!C4::Heading::valid_heading_subfield('600', 'i'), '600i not valid for bib'); |
59 |
|
62 |
|
60 |
ok(!C4::Heading::valid_bib_heading_subfield('012', 'a'), '012a invalid field'); |
63 |
ok(!C4::Heading::valid_heading_subfield('012', 'a'), '012a invalid field for bib'); |
61 |
} |
64 |
} |