|
Lines 6-21
Link Here
|
| 6 |
use strict; |
6 |
use strict; |
| 7 |
use warnings; |
7 |
use warnings; |
| 8 |
|
8 |
|
| 9 |
use Test::More tests => 30; |
9 |
use Test::More tests => 32; |
| 10 |
|
10 |
|
| 11 |
BEGIN { |
11 |
BEGIN { |
| 12 |
use_ok('C4::Tags'); |
12 |
use_ok('C4::Tags'); |
| 13 |
} |
13 |
} |
| 14 |
|
14 |
|
|
|
15 |
# Check no tags case. |
| 16 |
my @tagsarray; |
| 17 |
my $tags = \@tagsarray; |
| 18 |
my ($min, $max) = C4::Tags::stratify_tags(0, $tags); |
| 19 |
is($min, 0, 'Empty array min'); |
| 20 |
is($max, 0, 'Empty array max'); |
| 21 |
|
| 15 |
# Simple 'sequential 5' test |
22 |
# Simple 'sequential 5' test |
| 16 |
my $tags = make_tags(1,2,3,4,5); |
23 |
$tags = make_tags(1,2,3,4,5); |
| 17 |
my @strata = (0,1,2,3,4); |
24 |
my @strata = (0,1,2,3,4); |
| 18 |
my ($min, $max) = C4::Tags::stratify_tags(5, $tags); |
25 |
($min, $max) = C4::Tags::stratify_tags(5, $tags); |
| 19 |
check_tag_strata($tags, \@strata, 'Sequential 5'); |
26 |
check_tag_strata($tags, \@strata, 'Sequential 5'); |
| 20 |
is($min, 0, 'Sequential 5 min'); |
27 |
is($min, 0, 'Sequential 5 min'); |
| 21 |
is($max, 4, 'Sequential 5 max'); |
28 |
is($max, 4, 'Sequential 5 max'); |
| 22 |
- |
|
|