6 use Test::More 'no_plan';
8 #****h* ROBODoc System Tests/Item Test
10 # Tests the parsing generation of ROBODoc items.
14 #****x* Item Test/Sorting
16 # Lets see if we can get items sorted according
17 # to the order specified in a robodoc.rc file.
49 my $config_no_sort = <<'EOF';
57 add_source( "test.c", $source );
58 add_configuration( "robodoc.rc", $config );
59 my ($out, $err) = runrobo( qw(
61 --doc Doc --multidoc --ascii
62 --rc Config/robodoc.rc
64 is( $out, '', 'no output' );
65 is( $err, '', 'and no error' );
66 my $documentation = IO::File->new( "<Doc/test_c.txt" );
67 ok( $documentation, 'There is a doc file' );
69 while ( my $line = <$documentation> ) {
70 if ( $line =~ m/(SOURCE|THIRD|Second|FIRST)/ ) {
74 is( $items[ 0 ], 'SOURCE', 'First item it the source item' );
75 is( $items[ 1 ], 'THIRD', 'Second item it the third item' );
76 is( $items[ 2 ], 'FIRST', 'Third item it the first item' );
77 $documentation->close();
79 # Now the same but without sorting
80 add_configuration( "robodoc.rc", $config_no_sort );
81 my ($out2, $err2) = runrobo( qw(
83 --doc Doc --multidoc --ascii
84 --rc Config/robodoc.rc
86 is( $out2, '', 'no output' );
87 is( $err2, '', 'and no error' );
89 $documentation = IO::File->new( "<Doc/test_c.txt" );
90 ok( $documentation, 'There is a doc file' );
92 while ( my $line = <$documentation> ) {
93 if ( $line =~ m/(SOURCE|THIRD|Second|FIRST)/ ) {
97 is( $items[ 0 ], 'FIRST', 'First item it the first item' );
98 is( $items[ 1 ], 'Second', 'Second item it the second item' );
99 is( $items[ 2 ], 'THIRD', 'Third item it the third item' );
100 is( $items[ 3 ], 'SOURCE', 'Fourth item it the fourth' );
101 $documentation->close();