Added failing tests
[catagits/HTML-Zoom.git] / t / todo-repeat.t
diff --git a/t/todo-repeat.t b/t/todo-repeat.t
new file mode 100644 (file)
index 0000000..ca83f5e
--- /dev/null
@@ -0,0 +1,23 @@
+use strict;
+use HTML::Zoom;
+use Test::More;
+
+my $z = HTML::Zoom->from_html(<<HTML);
+<html>
+<body>
+<div id="foo"><p/></div>
+</body>
+</html>
+HTML
+
+my @list = qw(foo bar baz);
+my $iter = sub { shift @list };
+
+$z->select("#foo")->repeat(sub {
+    my $e = $iter->() or return;
+    return sub { $_->select("p")->replace_content($e) };
+})->to_html;
+
+ok 1;
+
+done_testing;