File: filters_map.t

package info (click to toggle)
libtest-base-perl 0.88-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 668 kB
  • ctags: 106
  • sloc: perl: 931; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 612 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use Test::Base tests => 7;

eval {
    filters_map {
        perl => ['eval'],
        text => ['chomp', 'lines', 'array'],
    };
};
like $@, qr{Can't locate object method "filters_map"};

filters {
    perl => ['eval'],
    text => ['chomp', 'lines', 'array'],
};

run {
    my $block = shift;
    is ref($block->perl), 'ARRAY';
    is ref($block->text), 'ARRAY';
    is_deeply $block->perl, $block->text;
};

__DATA__
=== One
--- perl
[
    "One\n",
    "2nd line\n",
    "\n",
    "Third time's a charm",
]
--- text
One
2nd line

Third time's a charm
=== Two
--- text
tic tac toe
--- perl
[ 'tic tac toe' ]