X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdom.t;h=e7ad2ecb93368889a4bbd1e2baeaa1e788fc1ee0;hb=b1ec524b3b6c75361f548d73cfda0282db607a9d;hp=a6b8a72d6a68109c10c2fda3485667bae6c8cf96;hpb=eb9737f29128e8d0c85fe9d2983abc937c9f3787;p=catagits%2FDOM-Tiny.git diff --git a/t/dom.t b/t/dom.t index a6b8a72..e7ad2ec 100644 --- a/t/dom.t +++ b/t/dom.t @@ -243,6 +243,8 @@ is $dom->at('b')->child_nodes->[1]->next, undef, 'no siblings'; is $dom->at('script')->child_nodes->first->wrap(':)')->root, '', 'right result'; is $dom->at('i')->child_nodes->first->wrap_content('')->root, + '', 'no changes'; +is $dom->at('i')->child_nodes->first->wrap('')->root, '', 'right result'; is $dom->at('b')->child_nodes->first->ancestors->map('tag')->join(','), 'b,i,script', 'right result'; @@ -1270,8 +1272,9 @@ is "$dom", <at('div')->text, 'A-1', 'right text'; is $dom->at('iv'), undef, 'no result'; -$dom->prepend('l')->prepend('alal')->prepend('a'); -is "$dom", <prepend('l')->prepend('alal')->prepend('a')->type, 'root', + 'right type'; +is "$dom", < 24
A-1
25
  • A
  • A1

    23

    B

    @@ -1279,8 +1282,8 @@ is "$dom", <
    D
    EOF -$dom->append('lalala'); -is "$dom", <append('lalala')->type, 'root', 'right type'; +is "$dom", < 24
    A-1
    25
  • A
  • A1

    23

    B

    @@ -2125,7 +2128,10 @@ is $dom->all_text, 'DOM Test', 'right text'; # Wrap elements $dom = DOM::Tiny->new('Test'); +is "$dom", 'Test', 'right result'; is $dom->wrap('')->type, 'root', 'right type'; +is "$dom", 'Test', 'no changes'; +is $dom->at('a')->wrap('')->type, 'tag', 'right type'; is "$dom", 'Test', 'right result'; is $dom->at('b')->strip->at('a')->wrap('A')->tag, 'a', 'right tag'; is "$dom", 'Test', 'right result'; @@ -2208,8 +2214,13 @@ $dom = DOM::Tiny->new(<

    Test

    + + + + +