Line 0
Link Here
|
0 |
- |
1 |
#!/usr/bin/perl |
|
|
2 |
|
3 |
# Copyright 2020 Rijksmuseum |
4 |
# |
5 |
# This file is part of Koha. |
6 |
# |
7 |
# Koha is free software; you can redistribute it and/or modify it |
8 |
# under the terms of the GNU General Public License as published by |
9 |
# the Free Software Foundation; either version 3 of the License, or |
10 |
# (at your option) any later version. |
11 |
# |
12 |
# Koha is distributed in the hope that it will be useful, but |
13 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
# GNU General Public License for more details. |
16 |
# |
17 |
# You should have received a copy of the GNU General Public License |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
|
20 |
# Testing private routine C4::Serials::_handle_seqno of ModSerialStatus |
21 |
|
22 |
use Modern::Perl; |
23 |
use Data::Dumper qw/Dumper/; |
24 |
|
25 |
use Test::More tests => 8; |
26 |
|
27 |
use C4::Serials qw//; |
28 |
|
29 |
# Testing C4::Serials::_handle_seqno |
30 |
my $list = '2017 (No. 8); 2017 (No. 9); 2017 (No. 10)'; |
31 |
is( C4::Serials::_handle_seqno( '2017 (No. 8)', $list ), $list, 'Not added 8' ); |
32 |
is( C4::Serials::_handle_seqno( '2017 (No. 9)', $list ), $list, 'Not added 9' ); |
33 |
is( C4::Serials::_handle_seqno( '2017 (No. 10)', $list ), $list, 'Not added 10' ); |
34 |
is( C4::Serials::_handle_seqno( '2017 (No. 11)', $list ), $list.'; 2017 (No. 11)', 'Added 11' ); |
35 |
is( C4::Serials::_handle_seqno( '2017 (No. 7)', $list, 'REMOVE'), $list, 'Not removed 7' ); |
36 |
is( C4::Serials::_handle_seqno( '2017 (No. 10)', $list, 'REMOVE') !~ /\(10\)/, 1, 'Removed 10' ); |
37 |
is( C4::Serials::_handle_seqno( '2017 (No. 8)', $list, 'CHECK'), 1, 'Found 8' ); |
38 |
is( C4::Serials::_handle_seqno( '2017 (No. 11)', $list, 'CHECK'), q{}, 'Not found 11' ); |