Add itercb, fid, fclass methods
[html-element-library.git] / t / misc.t
index a0ae26cb7cefcf3350296f13d736b356e85478cc..2af0efc81f05523f9f00f3be102c7b94157d131e 100644 (file)
--- a/t/misc.t
+++ b/t/misc.t
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -T
 use lib '.';
-use t::lib tests => 26;
+use t::lib tests => 27;
 
 ##################################################
 # Short tests based on mklol
@@ -123,6 +123,25 @@ isxml $tree, 't/html/dual_iter-exp.html', 'dual_iter';
 
 ###
 
+sub cb {
+       my ($data, $tr) = @_;
+       $tr->look_down(class => 'first')->replace_content($data->{first});
+       $tr->look_down(class => 'last')->replace_content($data->{last});
+       $tr->look_down(class => 'option')->replace_content($data->{option});
+}
+
+my @cbdata = (
+       {first => 'Foo', last => 'Bar', option => 2},
+       {first => 'Bar', last => 'Bar', option => 3},
+       {first => 'Baz', last => 'Bar', option => 4},
+);
+
+$tree = mktree 't/html/itercb.html';
+$tree->find('table')->find('tbody')->find('tr')->itercb(\@cbdata, \&cb);
+isxml $tree, 't/html/itercb-exp.html', 'itercb';
+
+###
+
 for my $age (qw/5 15 50/) {
        $tree = mktree 't/html/highlander.html';
        $tree->highlander(
This page took 0.009585 seconds and 4 git commands to generate.