]> git.donarmstrong.com Git - debbugs.git/blob - t/03_status.t
Use PT|passthrough redirects for ^/([0-9]+)$ for bugreport.cgi & ^/([^/]+)$ for pkgre...
[debbugs.git] / t / 03_status.t
1 # -*- mode: cperl;-*-
2
3 use Test::More tests => 6;
4
5 use warnings;
6 use strict;
7
8 use utf8;
9 use Encode;
10
11 use_ok('Debbugs::Status');
12
13 my $data = {package => 'foo, bar, baz',
14             blocks  => '1 2 3',
15             blockedby => '',
16             tags      => 'foo bar baz',
17            };
18
19 my @temp = Debbugs::Status::split_status_fields($data);
20 is_deeply($temp[0]{package},[qw(foo bar baz)],
21           'split_status_fields splits packages properly',
22          );
23 is_deeply($temp[0]{blocks},[qw(1 2 3)],
24           'split_status_fields splits blocks properly',
25          );
26 is_deeply($temp[0]{blockedby},[],
27           'split_status_fields handles empty fields properly',
28          );
29 is_deeply($temp[0]{tags},[qw(foo bar baz)],
30           'split_status_fields splits tags properly',
31          );
32 my $temp = Debbugs::Status::split_status_fields($data);
33 is_deeply(Debbugs::Status::split_status_fields($temp),$temp,
34           'recursively calling split_status_fields returns the same thing');