use strict; use Test::Base; use XML::Liberal; sub scrub { XML::Liberal->new('LibXML')->parse_string($_[0])->toString(); } filters { input => 'scrub' }; run_is 'input' => 'expected'; __END__ === Good XML --- input --- expected === Good XML --- input --- expected === Good XML --- input --- expected === Bad XML --- input & --- expected & === Bad XML --- input   --- expected   === Bad XML --- input --- expected === Bad XML --- input xxx --- expected xxx === Bad XML --- input --- expected === Bad XML --- input &foo --- expected &foo === Good XML --- input È --- expected È === Good XML --- input È --- expected È === Bad XML --- input È --- expected È === Bad XML --- input --- expected === Bad XML --- input --- expected === Bad XML --- input foo --- expected foo === Good XML --- input あいうえお --- expected あいうえお === Newline --- input foo bar --- expected foo bar === Newline --- input foo� bar --- expected foo bar