]>
Commit | Line | Data |
---|---|---|
aa016126 MG |
1 | #!/usr/bin/perl |
2 | use t::lib tests => 1; | |
3 | use lib 't'; | |
67e78ff2 | 4 | use SimpleClass; |
5 | ||
67e78ff2 | 6 | my $o = SimpleClass->new; |
aa016126 MG |
7 | my $tree = mktree 't/html/table-alt.html'; |
8 | ||
9 | $tree->table( | |
10 | gi_table => 'load_data', | |
11 | gi_tr => ['iterate1', 'iterate2'], | |
12 | table_data => $o->load_data, | |
13 | tr_data => sub { | |
14 | my ($self, $data) = @_; | |
15 | shift @{$data}; | |
16 | }, | |
17 | td_data => sub { | |
18 | my ($tr_node, $tr_data) = @_; | |
19 | $tr_node->content_handler($_ => $tr_data->{$_}) for qw(name age weight) | |
20 | }); | |
21 | ||
22 | isxml $tree, 't/html/table-alt.exp', 'table (alternating)'; |