use strict; use Test::Base; use utf8; use Web::Scraper; plan tests => 1 * blocks; filters { selector => 'chomp', expected => [ 'chomp', 'newline' ], html => 'newline', }; sub newline { s/\\n\n/\n/g; } run { my $block = shift; my $s = scraper { process $block->selector, want => 'HTML'; result 'want'; }; my $want = $s->scrape($block->html); is $want, $block->expected, $block->name; }; __DATA__ === script --- html --- selector script --- expected function foo() { return bar; } === a --- html foo bar --- selector a --- expected foo bar === div --- html

foo bar

bar

--- selector #foo --- expected

foo bar

bar

=== non-ascii --- html

テスト

--- selector #foo --- expected テスト === textarea --- html --- selector textarea --- expected \n foo bar \n baz