Bug 5327 added unit tests for C4/ClassSortRoutine/LCC
Signed-off-by: Chris Hall <chrish@catalyst.net.nz>
(cherry picked from commit 200b5a8231)
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
parent
dbf3a3df34
commit
2d113b9303
|
|
@ -6,9 +6,22 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
use Test::More tests => 9;
|
||||
|
||||
BEGIN {
|
||||
use_ok('C4::ClassSortRoutine::LCC');
|
||||
}
|
||||
|
||||
#Obvious cases
|
||||
is(C4::ClassSortRoutine::LCC::get_class_sort_key(), "", "No arguments returns an empty string");
|
||||
is(C4::ClassSortRoutine::LCC::get_class_sort_key('a','b'), "A_B", "Arguments 'a','b' return 'A_B'");
|
||||
|
||||
#spaces in arguements
|
||||
is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ','b'), "B_", "Arguments ' ','b' return 'B_'");
|
||||
is(C4::ClassSortRoutine::LCC::get_class_sort_key('a',' '), "A_", "Arguments 'a',' ' return 'A_'");
|
||||
is(C4::ClassSortRoutine::LCC::get_class_sort_key(' ',' '), "", "Arguments ' ',' ' return ''");
|
||||
|
||||
#'funky cases' based on regex in code
|
||||
is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','b'), "_B", "Arguments '.','b' return '_B'");
|
||||
is(C4::ClassSortRoutine::LCC::get_class_sort_key('....','........'), "_______", "Arguments '....','........' return '_______'");
|
||||
is(C4::ClassSortRoutine::LCC::get_class_sort_key('.','.'), "__", "Arguments '.','.' return '__'");
|
||||
|
|
|
|||
Loading…
Reference in New Issue