]> iEval git - html-element-library.git/blame - t/siblings.t
Refactor tests (first pass)
[html-element-library.git] / t / siblings.t
CommitLineData
aa016126
MG
1#!/usr/bin/perl
2use t::lib tests => 3;
3
4my $t1 = HTML::Element->new_from_lol(
5 ['html',
6 ['head',
7 [ 'title', 'I like stuff!' ]],
8 ['body', {id => 'corpus'}, {'lang', 'en-JP'},
9 'stuff',
10 ['p', 'um, p < 4!', {'class' => 'par123'}],
11 ['div', {foo => 'bar'}, '123'], # at 0.1.2
12 ['div', {jack => 'olantern'}, '456']]]); # at 0.1.2
67e78ff2 13
14my $div = $t1->look_down('_tag' => 'body')->look_down(_tag => 'p');
15my @sibs = $div->siblings;
16
aa016126
MG
17is $sibs[0], 'stuff', "first sibling is simple text";
18is $sibs[2]->tag, 'div', "3rd tag is a div tag";
19is scalar @sibs, 4, "4 siblings total";
This page took 0.024355 seconds and 4 git commands to generate.