Skip to content

Commit 73e4350

Browse files
committed
A couple more tests on ASTs
1 parent 7cfd3e2 commit 73e4350

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

t/00ast.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use LibXML::Item :&ast-to-xml;
88
use LibXML::Config;
99
use LibXML::Raw;
1010

11-
plan 11;
11+
plan 13;
1212

1313
LibXML::Config.keep-blanks = False; # Make it the test default
1414
my LibXML::Element $elem .= new('Test', config => LibXML::Config.new);
@@ -59,4 +59,10 @@ is-deeply $doc.ast, "#xml" => [ :$dromedaries ];
5959
$doc<dromedaries><species>[0].replaceNode: ast-to-xml('#comment' => 'youza');
6060
is $doc<dromedaries><comment()>, '<!--youza-->';
6161

62+
my $string = '<Foo bar="x"><bar bar="bar">bar</bar></Foo>';
63+
$doc .= parse: :$string;
64+
is-deeply $doc.ast, "#xml" => [:Foo[:bar<x>, :bar[:bar<bar>, 'bar']]];
65+
66+
is $doc.ast.&ast-to-xml().root.Str, $string;
67+
6268
done-testing;

0 commit comments

Comments
 (0)