]>
iEval git - html-element-library.git/blob - t/tables.t
7 [map { +{name
=> $_->[0], age
=> $_->[1], weight
=> $_->[2]} } (
20 ['437', 'MS-DOS', 'United States', '0', '1', '1', '1', '1'],
21 ['708', 'Arabic (ASMO 708)', '0', '1', '0', '0', '1'],
22 ['709', 'Arabic (ASMO 449+ BCON V4)', '0', '1', '0', '0', '1'],
23 ['710', 'Arabic (Transparent Arabic)', '0', '1', '0', '0', '1'],
24 ['720', 'Arabic (Transparent ASMO)', '0', '1', '0', '0', '1']],
26 ['1200', 'Unicode (BMP of ISO 10646)', '0', '0', '1', '1', '2'],
27 ['1250', 'Windows 3.1 Eastern European', '1', '0', '1', '1', '1'],
28 ['1251', 'Windows 3.1 Cyrillic', '1', '0', '1', '1', '1'],
29 ['1252', 'Windows 3.1 US (ANSI)', '1', '0', '1', '1', '1'],
30 ['1253', 'Windows 3.1 Greek', '1', '0', '1', '1', '1'],
31 ['1254', 'Windows 3.1 Turkish', '1', '0', '1', '1', '1'],
32 ['1255', 'Hebrew', '1', '0', '0', '0', '1'],
33 ['1256', 'Arabic', '1', '0', '0', '0', '1'],
34 ['1257', 'Baltic', '1', '0', '0', '0', '1'],
35 ['1361', 'Korean (Johab)', '1', '0', '0', '3', '1']]
39 $tree = mktree
't/html/table.html';
42 gi_table
=> 'load_data',
46 my ($self, $data) = @_;
50 my ($tr_node, $tr_data) = @_;
51 $tr_node->content_handler($_ => $tr_data->{$_}) for qw(name age weight)
54 isxml
$tree, 't/html/table-exp.html', 'table';
58 $tree = mktree
't/html/table-alt.html';
61 gi_table
=> 'load_data',
62 gi_tr
=> ['iterate1', 'iterate2'],
65 my ($self, $data) = @_;
69 my ($tr_node, $tr_data) = @_;
70 $tr_node->content_handler($_ => $tr_data->{$_}) for qw(name age weight)
73 isxml
$tree, 't/html/table-alt-exp.html', 'table (alternating)';
78 $tree = mktree
't/html/table2.html';
80 for my $dataset (keys %$d) {
81 my %tbody = ('4dig' => 0, '3dig' => 1);
83 debug
=> $ENV{TEST_VERBOSE
},
84 table_data
=> $d->{$dataset},
85 tr_base_id
=> $dataset,
88 my $tbody = ($t->look_down('_tag' => 'tbody'))[$tbody{$dataset}];
89 my @tbody_child = $tbody->content_list;
90 $tbody_child[$_]->detach for (1 .. $#tbody_child) ;
95 my @td = $tr->look_down('_tag' => 'td');
98 $td[$i]->splice_content(0, 1, $data->[$i]);
104 isxml
$tree, 't/html/table2-exp.html', 'table2';
108 # a - default table_ld
109 $tree = mktree
't/html/table2.html';
110 my $table = HTML
::Element
::Library
::ref_or_ld
(
114 isxml
$table, 't/html/table2-table_ld-exp.html', 'table2 look_down default';
118 # b - arrayref table_ld
119 $table = HTML
::Element
::Library
::ref_or_ld
(
121 [frame
=> 'hsides', rules
=> 'groups']
123 isxml
$table, 't/html/table2-table_ld-exp.html', 'table2 look_down arrayref';
125 # c - coderef table_ld
126 $table = HTML
::Element
::Library
::ref_or_ld
(
130 my $caption = $t->look_down('_tag' => 'caption');
134 isxml
$table, 't/html/table2-table_ld-exp.html', 'table2 look_down coderef';
138 # a - default table_ld
139 my @tr = HTML
::Element
::Library
::ref_or_ld
(
143 is
(scalar @tr, 16, 'table2 tr look_down (default)');
146 # removes windows listings before returning @tr
148 HTML
::Element
::Library
::ref_or_ld
(
152 my @trs = $t->look_down('_tag' => 'tr');
156 my @td = $tr->look_down ('_tag' => 'td') ;
159 if (grep { $_ =~ /Windows/ } $td->content_list) {
165 push @keep, $tr unless $detached;
170 isxml
$tree, 't/html/table2-tr_ld-coderef-exp.html', 'table2 tr look_down (coderef)';
174 $tree = mktree
't/html/table2-tr_ld-arrayref.html';
175 my $tr = HTML
::Element
::Library
::ref_or_ld
(
179 isxml
$tr, 't/html/table2-tr_ld-arrayref-exp.html', 'table2 tr look_down (arrayref)';
This page took 0.061268 seconds and 4 git commands to generate.