]>
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', {id => 'corpus'}, | |
17 | { | |
18 | 'lang', 'en-JP'}, | |
19 | 'stuff', | |
20 | ['p', 'um, p < 4!', {'class' => 'par123'}], | |
21 | ['div', {foo => 'bar'}, '123'], # at 0.1.2 | |
22 | ['div', {jack => 'olantern'}, '456'], # at 0.1.2 | |
23 | ] | |
24 | ] | |
25 | ) | |
26 | ; | |
27 | ||
28 | ||
29 | #$t1->look_down('_tag' => 'body')->replace_content('all gone!'); | |
30 | $t1->set_child_content(id => 'corpus', 'all gone!'); | |
6c133526 | 31 | is( $t1->as_HTML, '<html><head><title>I like stuff!</title></head><body id="corpus" lang="en-JP">all gone!</body></html>', "replaced all of body"); |
67e78ff2 | 32 | |
33 |