Akron | 4f67cd4 | 2020-07-02 12:27:58 +0200 | [diff] [blame] | 1 | use strict; |
| 2 | use warnings; |
| 3 | use Test::More; |
| 4 | use File::Temp 'tempfile'; |
| 5 | |
| 6 | use FindBin; |
| 7 | BEGIN { |
| 8 | unshift @INC, "$FindBin::Bin/../lib"; |
| 9 | }; |
| 10 | |
| 11 | require_ok('KorAP::XML::TEI'); |
| 12 | |
| 13 | my ($fh, $filename) = tempfile(); |
| 14 | |
| 15 | print $fh <<'HTML'; |
| 16 | mehrzeiliger |
| 17 | Kommentar |
| 18 | --> |
| 19 | Test |
| 20 | HTML |
| 21 | |
| 22 | is(KorAP::XML::TEI::delHTMLcom($fh, "hallo"),"hallo"); |
| 23 | is(KorAP::XML::TEI::delHTMLcom($fh, "hallo <!-- Test -->"),"hallo "); |
| 24 | is(KorAP::XML::TEI::delHTMLcom($fh, "<!-- Test --> hallo")," hallo"); |
| 25 | |
| 26 | seek($fh, 0, 0); |
| 27 | |
| 28 | is(KorAP::XML::TEI::delHTMLcom($fh, '<!--'), "Test\n"); |
| 29 | |
| 30 | done_testing; |