2 use warnings FATAL => 'all';
5 use HTML::Zoom::CodeStream;
10 # turns iterator into stream
14 HTML::Zoom::CodeStream->new({
23 <div class="item-name"></div>
28 my $zoom = HTML::Zoom->from_html($tmpl);
29 my @list = qw(foo bar baz);
31 foreach my $flush (0..1) {
33 # from HTML::Zoom manpage, slightly modified
34 my $z2 = $zoom->select('.item')->repeat(code_stream {
35 if (my $name = shift @list) {
36 return sub { $_->select('.item-name')->replace_content($name) }
40 }, { flush_before => $flush });
44 while (my $chunk = $fh->getline) {
49 cmp_ok($lineno, '==', 1+$flush, "flush_before => $flush is $lineno chunks");