Merge branch 'bug_9981' into 3.12-master
[koha.git] / t / ClassSortRoutine_Dewey.t
blob7a4d7f4e4c3b1c51b99dc1bc5379ed4510892fcb
1 #!/usr/bin/perl
3 # This Koha test module is a stub!
4 # Add more tests here!!!
6 use strict;
7 use warnings;
9 use Test::More tests => 6;
11 BEGIN {
12 use_ok('C4::ClassSortRoutine::Dewey');
15 my $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key(undef, undef );
16 is($cn_sort,"","testing whitespace");
18 $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("....",".....");
19 is($cn_sort,"","testing fullstops");
21 $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("123","456");
22 is($cn_sort,"123_456000000000000","testing numbers");
24 $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("abc123","456");
25 is($cn_sort,"ABC_123_456000000000000","testing alphanumeric");
27 $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("ab c123","45 6");
28 is($cn_sort,"AB_C123_45_600000000000000","testing middle whitespace");