| unshift @INC, "$FindBin::Bin/../lib"; |
| use Test::KorAP::XML::TEI qw!korap_tempfile!; |
| use_ok('KorAP::XML::TEI', 'remove_xml_comments', 'escape_xml'); |
| subtest 'remove_xml_comments' => sub { |
| my ($fh, $filename) = korap_tempfile('tei'); |
| is(remove_xml_comments($fh, "hallo"),"hallo"); |
| is(remove_xml_comments($fh, "hallo <!-- Test -->"),"hallo "); |
| is(remove_xml_comments($fh, "<!-- Test --> hallo")," hallo"); |
| is(remove_xml_comments($fh, '<!--'), "Test\n"); |
| -->ist <!-- a --><!-- b --> ein Test |
| is(remove_xml_comments($fh, 'Dies <!--'), "Dies ist ein Test\n"); |
| subtest 'escape_xml' => sub { |
| escape_xml('<tag att1="foo" att2="bar">C&A</tag>'), |
| '<tag att1="foo" att2="bar">C&A</tag>' |