Imported Robodoc.
[robodoc.git] / Source / Test / latex_specialchar_test.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use ROBOTest;
5
6 ROBOTest::start("LaTeX Special Char Test");
7
8 # In the headers there are three bad names
9 # bad1$bad1
10 # bad2$bad2
11 # bad3%bad3
12 # bad4$bad4
13 # bad5_bad5
14 #
15 # These should all have been escaped and no longer occur
16 # in the output
17
18 my $count = 0;
19 while (my $line = <>) {
20     if (($line =~ m/begin{verbatim/) ..
21         ($line =~ m/end{verbatim/)) {
22
23     } else {
24         if ($line =~ m/bad\d([^b]+)bad/) {
25             my $string = $1;
26             if (($string eq "\$") or
27             ($string eq "_") or
28             ($string eq "%")) {
29                 ++$count;
30             }
31         }
32     }
33 }
34
35 ROBOTest::assert($count == 0);
36 ROBOTest::finish;