Added options to make Robodoc more customizable.
[robodoc.git] / Source / Test / header_test2.pl
1 #!/usr/bin/perl -w
2
3 use ROBOTest;
4 ROBOTest::start("Indented Header Test");
5
6 # There are 12 headers numbered 1 .. 12
7 my $checksum = 0;
8 foreach my $n (1 .. 12) {
9     $checksum += $n;
10 }
11
12 # Now we scan the output file for the headers
13 # The should occur after a and compute the sum
14 # of the header numbers 
15 my $sum = 0;
16 # count the number of testmarkers and the number of
17 # Headers in <A HREF> blocks (table of content)
18 # and between the word "testmark" in the NAME item
19 # We extract the header number and compute the sum.
20 while (my $line = <>) {
21     if ($line =~ m/<PRE\S+\s+testmark\s+(\d+)\s/i) {
22         $sum += $1;
23     }
24     # These are in the table of content
25     if ($line =~ m/<A HREF[^\/]+\/Header_(\d+)<\/A>/i) {
26         $sum += $1;
27     }
28 }
29 # Dus each header number occur twice?
30 ROBOTest::assert($sum == 2 * $checksum);
31 ROBOTest::finish;
32