Skip to content

Commit

Permalink
a few more multi-line attribute tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 30, 2015
1 parent db359fc commit dcf6fde
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions t/mojo/dom.t
Expand Up @@ -774,8 +774,11 @@ is $dom->at('[test2=""]')->tag, 'div', 'right tag';
is $dom->at('[test3=""]'), undef, 'no result';

# Multi-line attribute
$dom = Mojo::DOM->new(qq{<div test="line1\nline2" />});
is $dom->at('div')->attr->{test}, "line1\nline2", 'multi-line attribute';
$dom = Mojo::DOM->new(qq{<div class="line1\nline2" />});
is $dom->at('div')->attr->{class}, "line1\nline2", 'multi-line attribute value';
is $dom->at('.line1')->tag, 'div', 'right tag';
is $dom->at('.line2')->tag, 'div', 'right tag';
is $dom->at('.line3'), undef, 'no result';

# Whitespaces before closing bracket
$dom = Mojo::DOM->new('<div >content</div>');
Expand Down

0 comments on commit dcf6fde

Please sign in to comment.