Imported Robodoc.
[robodoc.git] / Source / Test / header_test3.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use ROBOTest;
5
6 ROBOTest::start("Header Item Body Test");
7
8 # There are a number of headers. They contain items that
9 # have lines numbered __1__ to __20__
10 # They should all show up.
11 #
12 my $checksum = 0;
13 foreach my $n (1 .. 20) {
14     $checksum += $n;
15 }
16
17 # Now we scan the output file for the headers
18 # find the numbers and add them...
19 my $sum = 0;
20 while (my $line = <>) {
21     if ($line =~ m/__(\d+)__/) {
22         $sum += $1;
23     }
24 }
25
26 # Does each number occur ?
27
28 ROBOTest::assert( $sum == $checksum );
29 ROBOTest::finish;
30