]> iEval git - html-element-library.git/blame - t/siblings.t
hash_map method about to be public for real
[html-element-library.git] / t / siblings.t
CommitLineData
67e78ff2 1# Before `make install' is performed this script should be runnable with
2# `make test'. After `make install' it should work as `perl HTML-Element-Library.t'
3
4
5
6
7use strict;
8use Test::More qw(no_plan);
9
10use HTML::Element::Library;
11
12
13my $t1;
14my $lol;
15$t1 = HTML::Element->new_from_lol
16 (
17 $lol =
18 ['html',
19 ['head',
20 [ 'title', 'I like stuff!' ],
21 ],
22 ['body',
23 {
24 'lang', 'en-JP'},
25 'stuff',
26 ['p', 'um, p < 4!', {'class' => 'par123'}],
27 ['div', {foo => 'bar'}, '123'], # at 0.1.2
28 ['div', {jack => 'olantern'}, '456'], # at 0.1.2
29 ]
30 ]
31 )
32 ;
33
34my $div = $t1->look_down('_tag' => 'body')->look_down(_tag => 'p');
35my @sibs = $div->siblings;
36
37is($sibs[0], 'stuff', "first sibling is simple text");
38is($sibs[2]->tag, 'div', "3rd tag a div tag");
39is(scalar @sibs, 4, "4 siblings total");
40
This page took 0.025671 seconds and 4 git commands to generate.