1 # Each filter should have access to blocks/block internals.
2 use Test::Base tests => 20 * 2;
6 package Test::Base::Filter;
13 # Test access to Test::Base::Filter object.
18 '$self is a Test:Base::Filter object';
20 qr/^This is some .*text.\z/,
21 'Filter value is correct';
23 # Test access to Test::Base::Block object.
24 my $block = $self->current_block;
27 'Have a reference to our block object';
29 ok not($block->is_filtered),
30 'Block is not completely filtered yet';
32 my $name = shift || 'One';
37 my $description = shift || 'One';
38 is $block->description,
40 'description is correct';
42 my $original = shift || "This is some text.";
43 is $block->original_values->{xxx},
45 'Access to the original value';
47 my $seq_num = shift || 1;
48 cmp_ok $block->seq_num,
51 'Sequence number (seq_num) is correct';
53 my $array_xxx = shift || ["This is some text."];
54 is_deeply $block->{xxx},
56 'Test raw content of $block->{xxx}';
58 my $method_xxx = shift || "This is some text.";
61 'Test method content of $block->xxx';
63 # Test access to Test::Base object.
64 my $blocks = $block->blocks_object;
65 my $block_list = $blocks->block_list;
68 'Have an array of all blocks';
70 is scalar(@$block_list),
74 is $blocks->block_class,
78 is $blocks->filter_class,
85 'default filters are ok';
87 is $blocks->block_delim,
91 is $blocks->data_delim,
97 --- xxx foo: This is some text.
99 This is the 2nd description.
103 This is some more text.
110 is $block_list->[$seq_num - 1],
112 'test block ref in list';
120 "This is the 2nd description.\nRight here.",
121 "This is some more text.\n\n",
123 ["This is some more text."],
124 "This is some more text.",
130 --- xxx foo: This is some text.
132 This is the 2nd description.
136 This is some more text.