#!perl -T use Test::More tests => 4; use XML::Trivial; my $xmlstr = q{ /usr/local/myApplication
aaa
bbb
...and there is another stuff
Hello, world!
]]> ...more stuff here... ...]]>...
}; my $xml = XML::Trivial::parse($xmlstr); ok( defined $xml, 'xml doc parsed' ); ok( $xml->sr(), 'xml doc serialized' ); my $xmlstr2 = "<<"; my $xml2 = XML::Trivial::parse($xmlstr2); ok( $xml2->sr() eq $xmlstr2, 'serialized data escaped' ); my $xmlstr3 = XML::Trivial::parse(q{ /usr/local/myApplication
aaa
bbb
...and there is another stuff
Hello, world!
]]> ...more stuff here... ...]]>...
})->sr; my $xmlstr4 = XML::Trivial::parse($xmlstr3)->sr; ok( $xmlstr3 eq $xmlstr4, 'double serialized equals' );