]>
Commit | Line | Data |
---|---|---|
67e78ff2 | 1 | use strict; |
2 | use Test::More qw(no_plan); | |
3 | ||
4 | use HTML::Element::Library; | |
5 | ||
6 | ||
7 | my $t1; | |
8 | my $lol; | |
9 | $t1 = HTML::Element->new_from_lol | |
10 | ( | |
11 | $lol = | |
12 | ['html', | |
13 | ['head', | |
14 | [ 'title', 'I like stuff!' ], | |
15 | ], | |
16 | ['body', | |
17 | { | |
18 | 'lang', 'en-JP'}, | |
19 | 'stuff', | |
20 | ['p', | |
21 | ['span', {id => 'wrapme'}, | |
22 | 'um, p < 4!', | |
23 | ], | |
24 | {'class' => 'par123'}], | |
25 | ['div', {foo => 'bar'}, '123'], # at 0.1.2 | |
26 | ['div', {jack => 'olantern'}, '456'], # at 0.1.2 | |
27 | ] | |
28 | ] | |
29 | ) | |
30 | ; | |
31 | ||
32 | my $bold = HTML::Element->new('b', id => 'wrapper'); | |
33 | ||
34 | my $W = $t1->look_down('id' => 'wrapme'); | |
35 | $W->wrap_content($bold); | |
36 | is( $W->as_HTML, '<span id="wrapme"><b id="wrapper">um, p < 4!</b></span> | |
37 | ', "wrapped text"); | |
38 | ||
39 |