Bug 30588: Add tests for the REST API routes
[koha-ffzg.git] / t / Labels_split_ddcn.t
index 7579de2..eaf92e8 100755 (executable)
@@ -37,12 +37,12 @@ BEGIN {
     }
     my $test_num = 1;
     foreach (keys(%$ddcns)) {
-        my $split_num += scalar(@{$ddcns->{$_}});
+        my $split_num = scalar(@{$ddcns->{$_}});
         $test_num += 2 * $split_num;
         $test_num += 4;
     }
     plan tests => $test_num;
-    use_ok('C4::Labels::Label');
+    use_ok('C4::ClassSplitRoutine::Dewey', qw( split_callnumber ));
     use vars qw($ddcns);
 }
 
@@ -50,7 +50,8 @@ foreach my $ddcn (sort keys %$ddcns) {
     my (@parts, @expected);
     ok($ddcn, "ddcn: $ddcn");
     ok(@expected = @{$ddcns->{$ddcn}}, "split expected to produce " . scalar(@expected) . " pieces");
-    ok(@parts = C4::Labels::Label::_split_ddcn($ddcn), "C4::Labels::Label::_split_ddcn($ddcn)");
+    ok(@parts = C4::ClassSplitRoutine::Dewey::split_callnumber($ddcn), "Dewey::split_callnumber($ddcn)");
+
     ok(scalar(@expected) == scalar(@parts), sprintf("%d of %d pieces produced", scalar(@parts), scalar(@expected)));
     my $i = 0;
     foreach my $unit (@expected) {