f053ca0c22
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
28 lines
852 B
Perl
Executable file
28 lines
852 B
Perl
Executable file
#!/usr/bin/perl
|
|
#
|
|
# This Koha test module is a stub!
|
|
# Add more tests here!!!
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use Test::More tests => 6;
|
|
|
|
BEGIN {
|
|
use_ok('C4::ClassSortRoutine::Dewey');
|
|
}
|
|
|
|
my $cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key(undef, undef );
|
|
is($cn_sort,"","testing whitespace");
|
|
|
|
$cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("....",".....");
|
|
is($cn_sort,"","testing fullstops");
|
|
|
|
$cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("123","456");
|
|
is($cn_sort,"123_456000000000000","testing numbers");
|
|
|
|
$cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("abc123","456");
|
|
is($cn_sort,"ABC_123_456000000000000","testing alphanumeric");
|
|
|
|
$cn_sort = C4::ClassSortRoutine::Dewey::get_class_sort_key("ab c123","45 6");
|
|
is($cn_sort,"AB_C123_45_600000000000000","testing middle whitespace");
|