Bug 5549 Followup: fix suspension in days
[koha.git] / t / ClassSortRoutine_LCC.t
blob573c8fe840e1159b652e9e6aa0d8f864915d51a2
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 => 9;
11 BEGIN {
12 use_ok('C4::ClassSortRoutine::LCC');
15 #Obvious cases
16 is(C4::ClassSortRoutine::LCC::get_class_sort_key(), "", "No arguments returns an empty string");
17 is(C4::ClassSortRoutine::LCC::get_class_sort_key('a','b'), "A_B", "Arguments 'a','b' return 'A_B'");
19 #spaces in arguements
20 is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ','b'), "B_", "Arguments ' ','b' return 'B_'");
21 is(C4::ClassSortRoutine::LCC::get_class_sort_key('a',' '), "A_", "Arguments 'a',' ' return 'A_'");
22 is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ',' '), "", "Arguments ' ',' ' return ''");
24 #'funky cases' based on regex in code
25 is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','b'), "_B", "Arguments '.','b' return '_B'");
26 is(C4::ClassSortRoutine::LCC::get_class_sort_key('....','........'), "_______", "Arguments '....','........' return '_______'");
27 is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','.'), "__", "Arguments '.','.' return '__'");