View | Details | Raw Unified | Return to bug 24674
Collapse All | Expand All

(-)a/t/db_dependent/Biblio/TransformMarcToKoha.t (-3 / +7 lines)
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 => 12;
97
    plan tests => 17;
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 104-110 subtest 'Testing _adjust_pubyear' => sub { Link Here
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'), undef, 'Too short return nothing as data must be int' );
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-'), undef, 'Missing question mark, nothing is returned as data must be int' );
107
    is( C4::Biblio::_adjust_pubyear('198-'), '1980', '198-' );
108
    is( C4::Biblio::_adjust_pubyear('19--'), '1900', '19--' );
109
    is( C4::Biblio::_adjust_pubyear('19-'),  '1900', '19-' );
110
    is( C4::Biblio::_adjust_pubyear('2---'), '2000', '2---' );
111
    is( C4::Biblio::_adjust_pubyear('2--'),  '2000', '2--' );
112
    is( C4::Biblio::_adjust_pubyear('2-'),   '2000', '2-' );
108
    is( C4::Biblio::_adjust_pubyear('198-?'), '1980', '198-?' );
113
    is( C4::Biblio::_adjust_pubyear('198-?'), '1980', '198-?' );
109
    is( C4::Biblio::_adjust_pubyear('1981-'), '1981', 'Date range returns first date' );
114
    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' );
115
    is( C4::Biblio::_adjust_pubyear('broken'), undef, 'Non-matchign data returns nothing as the field must be int' );
111
- 

Return to bug 24674