]> git.donarmstrong.com Git - debbugs.git/commitdiff
add split_status tests in 03_status
authorDon Armstrong <don@donarmstrong.com>
Fri, 19 Jun 2009 03:16:06 +0000 (20:16 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 19 Jun 2009 03:16:06 +0000 (20:16 -0700)
t/03_status.t [new file with mode: 0644]

diff --git a/t/03_status.t b/t/03_status.t
new file mode 100644 (file)
index 0000000..eec2d54
--- /dev/null
@@ -0,0 +1,34 @@
+# -*- mode: cperl;-*-
+
+use Test::More tests => 6;
+
+use warnings;
+use strict;
+
+use utf8;
+use Encode;
+
+use_ok('Debbugs::Status');
+
+my $data = {package => 'foo, bar, baz',
+           blocks  => '1 2 3',
+           blockedby => '',
+           tags      => 'foo, bar  , baz',
+          };
+
+my @temp = Debbugs::Status::split_status_fields($data);
+is_deeply($temp[0]{package},[qw(foo bar baz)],
+         'split_status_fields splits packages properly',
+        );
+is_deeply($temp[0]{blocks},[qw(1 2 3)],
+         'split_status_fields splits blocks properly',
+        );
+is_deeply($temp[0]{blockedby},[],
+         'split_status_fields handles empty fields properly',
+        );
+is_deeply($temp[0]{tags},[qw(foo bar baz)],
+         'split_status_fields splits tags properly',
+        );
+my $temp = Debbugs::Status::split_status_fields($data);
+is_deeply(Debbugs::Status::split_status_fields($temp),$temp,
+         'recursively calling split_status_fields returns the same thing');