File: | t/ClassSortRoutine_Dewey.t |
Coverage: | 100.0% |
line | stmt | bran | cond | sub | time | code |
---|---|---|---|---|---|---|
1 | #!/usr/bin/perl | |||||
2 | # | |||||
3 | # This Koha test module is a stub! | |||||
4 | # Add more tests here!!! | |||||
5 | ||||||
6 | 1 1 1 | 1.33283522284034e+15 2 25 | use strict; | |||
7 | 1 1 1 | 4 1 34 | use warnings; | |||
8 | ||||||
9 | 1 1 1 | 585 20374 46 | use Test::More tests => 6; | |||
10 | ||||||
11 | BEGIN { | |||||
12 | 1 | 1299 | use_ok('C4::ClassSortRoutine::Dewey'); | |||
13 | } | |||||
14 | ||||||
15 | 1 | 189818 | my $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key(undef, undef ); | |||
16 | 1 | 7 | is($cn_sort,"","testing whitespace"); | |||
17 | ||||||
18 | 1 | 995 | $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("....","....."); | |||
19 | 1 | 9 | is($cn_sort,"","testing fullstops"); | |||
20 | ||||||
21 | 1 | 803 | $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("123","456"); | |||
22 | 1 | 9 | is($cn_sort,"123_456000000000000","testing numbers"); | |||
23 | ||||||
24 | 1 | 805 | $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("abc123","456"); | |||
25 | 1 | 6 | is($cn_sort,"ABC_123_456000000000000","testing alphanumeric"); | |||
26 | ||||||
27 | 1 | 740 | $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("ab c123","45 6"); | |||
28 | 1 | 8 | is($cn_sort,"AB_C123_45_600000000000000","testing middle whitespace"); |