File Coverage

t/PerlySense-Editor-Emacs-line-wrap.t
Criterion Covered Total %
statement 43 43 100.0
branch 1 2 50.0
condition n/a
subroutine 10 10 100.0
pod n/a
total 54 55 98.1


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2 1     1   117107 use strict;
  1         2  
  1         71  
3              
4 1     1   538 use Test::More tests => 12;
  1         17762  
  1         10  
5 1     1   1652 use Test::Exception;
  1         4014  
  1         6  
6 1     1   1480 use Test::Differences;
  1         13351  
  1         70  
7              
8 1     1   548 use Data::Dumper;
  1         5297  
  1         52  
9              
10              
11 1     1   317 use lib "../lib";
  1         532  
  1         4  
12              
13 1     1   89888 use_ok("Devel::PerlySense");
  1         703  
  1         2  
  1         2  
  1         5  
14 1     1   272 use_ok("Devel::PerlySense::Class");
  1         74  
  1         2  
  1         1  
  1         6  
15 1     1   192 use_ok("Devel::PerlySense::Editor::Emacs");
  1         331  
  1         2  
  1         2  
  1         10  
16              
17              
18 1 50   1   1433 BEGIN { -d "t" and chdir("t"); }
19              
20              
21              
22 1         281 ok(my $oPerlySense = Devel::PerlySense->new(), "Created PerlySense object ok");
23 1         210 ok(
24             my $oEditor = Devel::PerlySense::Editor::Emacs->new(
25             oPerlySense => $oPerlySense,
26             widthDisplay => 10,
27             ),
28             "Created Editor ok",
29             );
30              
31              
32              
33 1         191 is(
34             $oEditor->textLineWrapped("12345"),
35             "12345",
36             "Line wrap 5 chars, no wrap",
37             );
38              
39 1         312 is(
40             $oEditor->textLineWrapped("1234567890"),
41             "1234567890",
42             "Line wrap 10 chars, no wrap",
43             );
44              
45 1         190 is(
46             $oEditor->textLineWrapped("1234567890a"),
47             "1234567890\na",
48             "Line wrap 11 chars, wrap 1",
49             );
50              
51 1         187 is(
52             $oEditor->textLineWrapped("1234567890abcdefghi"),
53             "1234567890\nabcdefghi",
54             "Line wrap 19 chars, wrap 9",
55             );
56              
57 1         189 is(
58             $oEditor->textLineWrapped("1234567890abcdefghij"),
59             "1234567890\nabcdefghij",
60             "Line wrap 20 chars, wrap two lines",
61             );
62              
63 1         187 is(
64             $oEditor->textLineWrapped("1234567890abcdefghijABC"),
65             "1234567890\nabcdefghij\nABC",
66             "Line wrap 20 chars, wrap two lines, plus a little",
67             );
68              
69 1         193 is(
70             $oEditor->textLineWrapped("1234567890abcdefghijABCDEFGHIJ"),
71             "1234567890\nabcdefghij\nABCDEFGHIJ",
72             "Line wrap 20 chars, wrap three lines",
73             );
74              
75              
76              
77              
78              
79             __END__
80