Lines 94-100
subtest 'Multiple mappings for one kohafield' => sub {
Link Here
|
94 |
}; |
94 |
}; |
95 |
|
95 |
|
96 |
subtest 'Testing _adjust_pubyear' => sub { |
96 |
subtest 'Testing _adjust_pubyear' => sub { |
97 |
plan tests => 10; |
97 |
plan tests => 12; |
98 |
|
98 |
|
99 |
is( C4::Biblio::_adjust_pubyear('2004 c2000 2007'), 2000, 'First cYEAR' ); |
99 |
is( C4::Biblio::_adjust_pubyear('2004 c2000 2007'), 2000, 'First cYEAR' ); |
100 |
is( C4::Biblio::_adjust_pubyear('2004 2000 2007'), 2004, 'First year' ); |
100 |
is( C4::Biblio::_adjust_pubyear('2004 2000 2007'), 2004, 'First year' ); |
Lines 103-111
subtest 'Testing _adjust_pubyear' => sub {
Link Here
|
103 |
is( C4::Biblio::_adjust_pubyear('197X'), 1970, '197X on its own' ); |
103 |
is( C4::Biblio::_adjust_pubyear('197X'), 1970, '197X on its own' ); |
104 |
is( C4::Biblio::_adjust_pubyear('1...'), 1000, '1... on its own' ); |
104 |
is( C4::Biblio::_adjust_pubyear('1...'), 1000, '1... on its own' ); |
105 |
is( C4::Biblio::_adjust_pubyear('12?? 13xx'), 1200, '12?? first' ); |
105 |
is( C4::Biblio::_adjust_pubyear('12?? 13xx'), 1200, '12?? first' ); |
106 |
is( C4::Biblio::_adjust_pubyear('12? 1x'), '12? 1x', 'Too short' ); |
106 |
is( C4::Biblio::_adjust_pubyear('12? 1x'), undef, 'Too short return nothing as data must be int' ); |
107 |
is( C4::Biblio::_adjust_pubyear('198-'), '198-', 'Missing question mark' ); |
107 |
is( C4::Biblio::_adjust_pubyear('198-'), undef, 'Missing question mark, nothing is returned as data must be int' ); |
108 |
is( C4::Biblio::_adjust_pubyear('198-?'), '1980', '198-?' ); |
108 |
is( C4::Biblio::_adjust_pubyear('198-?'), '1980', '198-?' ); |
|
|
109 |
is( C4::Biblio::_adjust_pubyear('1981-'), '1981', 'Date range returns first date' ); |
110 |
is( C4::Biblio::_adjust_pubyear('broken'), undef, 'Non-matchign data returns nothing as the field must be int' ); |
109 |
}; |
111 |
}; |
110 |
|
112 |
|
111 |
subtest 'Test repeatable subfields' => sub { |
113 |
subtest 'Test repeatable subfields' => sub { |
112 |
- |
|
|