Debian Codegraph @

t/01text05.t

raw
1 #! perl
2
3 use strict;
4 use warnings;
5 use Test::More qw(no_plan);
6
7 use Data::Report;
8
9 my $rep = Data::Report::->create(type => "text");
10
11 $rep->set_layout
12 ([ { name => "one", title => "One", width => 10, },
13 { name => "two", title => "Two", width => 11, },
14 { name => "thr", title => "Three", width => 12, },
15 { name => "fou", title => "Four", width => 13, },
16 { name => "fiv", title => "Five", width => 14, },
17 ]);
18
19 my $ref; { undef $/; $ref = <DATA>; }
20 $ref =~ s/[\r\n]/\n/g;
21 my $out = "";
22
23 my $dd = "The quick brown fox jumps over the lazy dog.";
24 $dd = "$dd $dd $dd";
25
26 $rep->set_output(\$out);
27 $rep->start;
28 $rep->add({ one => $dd, two => $dd, thr => $dd, fou => $dd, fiv => $dd });
29 $rep->finish;
30
31 is($out, $ref);
32
33 __DATA__
34 One Two Three Four Five
35 --------------------------------------------------------------------
36 The quick The quick The quick The quick The quick
37 brown fox brown fox brown fox brown fox brown fox
38 jumps over jumps over jumps over jumps over jumps over the
39 the lazy the lazy the lazy the lazy dog. lazy dog. The
40 dog. The dog. The dog. The The quick quick brown
41 quick quick brown quick brown brown fox fox jumps over
42 brown fox fox jumps fox jumps jumps over the lazy dog.
43 jumps over over the over the the lazy dog. The quick
44 the lazy lazy dog. lazy dog. The quick brown fox
45 dog. The The quick The quick brown fox jumps over the
46 quick brown fox brown fox jumps over lazy dog.
47 brown fox jumps over jumps over the lazy dog.
48 jumps over the lazy the lazy
49 the lazy dog. dog.
50 dog.