Merge remote-tracking branch 'origin/new/bug_5327'

This commit is contained in:
Paul Poulain 2012-01-17 15:35:19 +01:00
commit a642b1c72a
4 changed files with 37 additions and 8 deletions

View file

@ -6,9 +6,23 @@
use strict;
use warnings;
use Test::More tests => 1;
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");

View file

@ -6,9 +6,19 @@
use strict;
use warnings;
use Test::More tests => 1;
use Test::More tests => 3;
BEGIN {
use_ok('C4::ClassSortRoutine::Generic');
}
my $cn_class = "My class ";
my $cn_item = " hellO";
my $cn_sort = C4::ClassSortRoutine::Generic::get_class_sort_key($cn_class, $cn_item);
is($cn_sort,"MY_CLASS_HELLO","testing cnsort");
$cn_sort = C4::ClassSortRoutine::Generic::get_class_sort_key(undef, undef);
is($cn_sort,"","Testing blank cnsort");

View file

@ -6,9 +6,11 @@
use strict;
use warnings;
use Test::More tests => 1;
use Test::More tests => 2;
BEGIN {
use_ok('C4::Reports');
}
ok(GetDelimiterChoices(),"Testing getting delimeter choices"); #Not testing the value of the output just that it returns something.

View file

@ -7,7 +7,7 @@ use strict;
use warnings;
use C4::Auth;
use CGI;
use Test::More tests => 10;
use Test::More tests => 11;
BEGIN {
use_ok('C4::BackgroundJob');
@ -17,8 +17,8 @@ my ($userid, $cookie, $sessionID) = &checkauth($query, 1);
#my ($sessionID, $job_name, $job_invoker, $num_work_units) = @_;
my $background;
diag $sessionID;
ok ($background=C4::BackgroundJob->new($sessionID));
ok ($background->id);
ok ($background=C4::BackgroundJob->new($sessionID), "making job");
ok ($background->id, "fetching id number");
$background->name("George");
is ($background->name, "George", "testing name");
@ -29,12 +29,15 @@ is ($background->invoker, "enjoys", "testing invoker");
$background->progress("testing");
is ($background->progress, "testing", "testing progress");
ok ($background->status);
ok ($background->status, "testing status");
$background->size("56");
is ($background->size, "56", "testing size");
ok (!$background->fetch($sessionID, $background->id), "testing fetch");
$background->finish("finished");
is ($background->status,'completed', "testing finished");
ok ($background->results); # Will return undef unless finished
ok ($background->results); #Will return undef unless finished