]> iEval git - html-element-library.git/blob - t/siblings.t
d1e753ec8be31acbcbbff16936237557f5cf6514
[html-element-library.git] / t / siblings.t
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
7 use strict;
8 use Test::More qw(no_plan);
9
10 use HTML::Element::Library;
11
12
13 my $t1;
14 my $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
34 my $div = $t1->look_down('_tag' => 'body')->look_down(_tag => 'p');
35 my @sibs = $div->siblings;
36
37 is($sibs[0], 'stuff', "first sibling is simple text");
38 is($sibs[2]->tag, 'div', "3rd tag a div tag");
39 is(scalar @sibs, 4, "4 siblings total");
40
This page took 0.018657 seconds and 3 git commands to generate.