File Coverage

t/PerlySense-Editor-Emacs-item-in-groups.t
Criterion Covered Total %
statement 53 53 100.0
branch 1 2 50.0
condition n/a
subroutine 10 10 100.0
pod n/a
total 64 65 98.4


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2 1     1   130981 use strict;
  1         2  
  1         71  
3              
4 1     1   576 use Test::More tests => 17;
  1         15327  
  1         9  
5 1     1   1954 use Test::Exception;
  1         25995  
  1         7  
6 1     1   834 use Test::Differences;
  1         10542  
  1         57  
7              
8 1     1   454 use Data::Dumper;
  1         5220  
  1         47  
9              
10              
11 1     1   297 use lib "../lib";
  1         525  
  1         3  
12              
13 1     1   73544 use_ok("Devel::PerlySense");
  1         587  
  1         2  
  1         2  
  1         7  
14 1     1   777 use_ok("Devel::PerlySense::Class");
  1         81  
  1         2  
  1         1  
  1         8  
15 1     1   500 use_ok("Devel::PerlySense::Editor::Emacs");
  1         373  
  1         2  
  1         1  
  1         9  
16              
17              
18 1 50   1   1421 BEGIN { -d "t" and chdir("t"); }
19              
20              
21              
22 1         275 ok(my $oPerlySense = Devel::PerlySense->new(), "Created PerlySense object ok");
23 1         203 ok(
24             my $oEditor = Devel::PerlySense::Editor::Emacs->new(
25             oPerlySense => $oPerlySense,
26             widthDisplay => undef,
27             ),
28             "Created Editor ok",
29             );
30              
31              
32 1         189 my $raItem;
33              
34              
35 1         1 $raItem = [];
36 1         6 eq_or_diff(
37             $oEditor->raItemInNGroups($raItem, 1),
38             [ ],
39             "No items, one group",
40             );
41 1         740 eq_or_diff(
42             $oEditor->raItemInNGroups($raItem, 2),
43             [ ],
44             "No items, two groups",
45             );
46              
47              
48              
49 1         527 $raItem = [qw/ a /];
50 1         3 eq_or_diff(
51             $oEditor->raItemInNGroups($raItem, 1),
52             [ ["a"] ],
53             "One item, one group",
54             );
55 1         531 eq_or_diff(
56             $oEditor->raItemInNGroups($raItem, 2),
57             [ ["a"] ],
58             "One item, two groups",
59             );
60 1         508 eq_or_diff(
61             $oEditor->raItemInNGroups($raItem, 3),
62             [ ["a"] ],
63             "One item, three groups",
64             );
65              
66              
67              
68 1         499 $raItem = [qw/ a b /];
69 1         3 eq_or_diff(
70             $oEditor->raItemInNGroups($raItem, 1),
71             [ ["a", "b"] ],
72             "Two items, one group",
73             );
74 1         653 eq_or_diff(
75             $oEditor->raItemInNGroups($raItem, 2),
76             [ ["a"], ["b"] ],
77             "Two items, two groups",
78             );
79 1         562 eq_or_diff(
80             $oEditor->raItemInNGroups($raItem, 3),
81             [ ["a"], ["b"] ],
82             "Two items, three groups",
83             );
84              
85              
86 1         520 $raItem = [qw/ a b c d e f g h i j k /];
87 1         3 eq_or_diff(
88             $oEditor->raItemInNGroups($raItem, 1),
89             [ [qw/ a b c d e f g h i j k /] ],
90             "11 Items, one group",
91             );
92 1         588 eq_or_diff(
93             $oEditor->raItemInNGroups($raItem, 2),
94             [ [qw/ a b c d e f /], [qw/ g h i j k /] ],
95             "11 Items, two groups",
96             );
97 1         600 eq_or_diff(
98             $oEditor->raItemInNGroups($raItem, 3),
99             [ [qw/ a b c d /], [qw/ e f g h /], [qw/ i j k /] ],
100             "11 Items, three groups",
101             );
102              
103 1         617 eq_or_diff(
104             $oEditor->raItemInNGroups($raItem, 4),
105             [ [qw/ a b c /], [qw/ d e f /], [qw/ g h i /], [qw/ j k /] ],
106             "11 Items, four group",
107             );
108              
109              
110              
111              
112             __END__
113