Imported Robodoc.
[robodoc.git] / Source / t / encoding.t
1 #!/usr/bin/perl -w
2 # vi: ff=unix spell
3
4 #****h* ROBODoc System Tests/Encoding
5 # FUNCTION
6 #    Test decoding en encoding of non 7bit ASCII characters.
7 #*****
8
9 use strict;
10 use warnings;
11 use ROBOTestFrame;
12 use Test::More 'no_plan';
13 use Test::File;
14 use XML::Simple;
15 use Data::Dumper;
16
17 #
18 # This tests a header with item names that start with 
19 # an letter with an umlaut.
20 # ROBODoc currently has some problems with this.
21 #
22
23 {
24     my $source = read_hexdump( 'TestData/iso8859-1_german_header_c.xxd' );
25     my $config = read_hexdump( 'TestData/iso8859-1_german_robodoc_rc.xxd' );
26
27     add_source( "test.c", $source, 'binary' );
28     add_configuration( "test.rc", $config, 'binary' );
29     mkdocdir();
30     my ( $out, $err ) = runrobo(qw(
31         --src Src
32         --doc Doc/test
33         --rc Config/test.rc
34         --singledoc --test --nopre ));
35     # expected results:
36     is( $out, '', 'No ouput' );
37     is( $err, '', '... and no error' );
38     file_exists_ok( "Doc/test.xml", 'there should be documentation' );
39
40     my $documentation = XMLin( 'Doc/test.xml' );
41     my $header = $documentation->{'header'};
42 #    is ( $header->{'name'}, 'Test Foo Bar/Name With Spaces', 'Header name' );
43     my $items = $header->{'item'};
44     print Dumper( $items );
45     my $body = $items->{'FUNCTION'}->{'item_body'};
46
47     # TODO  currently a bug in robodoc.
48     is( $body->{'pre'}, undef, 'No preformatted stuff in the body' );
49     clean();
50 }
51
52