use warnings FATAL => 'all';
use HTML::Zoom;
-use HTML::Zoom::CodeStream;
-
use Test::More;
-
-# turns iterator into stream
-sub code_stream (&) {
- my $code = shift;
- return sub {
- HTML::Zoom::CodeStream->new({
- code => $code,
- });
- }
-}
-
my $tmpl = <<'TMPL';
<body>
<div class="item">
foreach my $flush (0..1) {
# from HTML::Zoom manpage, slightly modified
- my $z2 = $zoom->select('.item')->repeat(code_stream {
+ my $z2 = $zoom->select('.item')->repeat(sub {
if (my $name = shift @list) {
return sub { $_->select('.item-name')->replace_content($name) }
} else {