Add the following packages libalgorithm-diff-perl libspiffy-perl libtext-diff-perl...
[pkg-perl] / deb-src / libtest-base-perl / libtest-base-perl-0.54 / t / flatten.t
1 use Test::Base tests => 4;
2
3 run_is_deeply in => 'out';
4
5 filters_delay;
6
7 my ($b3, $b4) = blocks('bad');
8
9 eval { $b3->run_filters };
10 like "$@", qr"Input to the 'flatten' filter must be a scalar";
11
12 eval { $b4->run_filters };
13 like "$@", qr"Can only flatten a hash or array ref";
14
15 __END__
16 ===
17 --- in eval flatten array
18 {
19     one => 'won',
20     two => 'too',
21     three => 'thrice',
22 }
23 --- out lines chomp array
24 one
25 won
26 three
27 thrice
28 two
29 too
30
31 ===
32 --- in eval flatten array
33 [qw(one two three four)]
34 --- out lines chomp array
35 one
36 two
37 three
38 four
39
40 ===
41 --- bad lines flatten
42 one
43 two
44
45 ===
46 --- bad flatten: foo bar baz