]> git.donarmstrong.com Git - debbugs.git/blob - t/03_versions.t
Use natatime instead of page in update-bugs
[debbugs.git] / t / 03_versions.t
1 # -*- mode: cperl;-*-
2
3 use Test::More tests => 5;
4
5 use warnings;
6 use strict;
7
8 use Storable qw(dclone);
9
10 # First, lets create a dataset for the illustrious foo package
11
12 my %data = (package => q(foo),
13             found_versions   => ['bar/1.00',
14                                  '1.00',
15                                  '1.34',
16                                 ],
17             fixed_versions   => ['bar/1.02',
18                                  '1.45',
19                                 ],
20            );
21
22
23 use_ok('Debbugs::Status',qw(:versions));
24 # check removefoundversions
25 my $data = dclone(\%data);
26 removefoundversions($data,$data->{package},'1.00');
27 is_deeply($data->{found_versions},['1.34'],'removefoundversions removes all 1.00 versions');
28 $data = dclone(\%data);
29 removefoundversions($data,$data->{package},'bar/1.00');
30 is_deeply($data->{found_versions},['1.00','1.34'],'removefoundversions removes only bar/1.00 versions');
31 $data = dclone(\%data);
32 addfoundversions($data,$data->{package},'1.45');
33 is_deeply($data->{fixed_versions},['bar/1.02'],'addfoundversions removes fixed versions');
34 is_deeply($data->{found_versions},['bar/1.00',
35                                    '1.00',
36                                    '1.34',
37                                    'foo/1.45',
38                                   ],,'addfoundversions adds found versions');