1#!perl
2# Copyright (C) 2001-2005, Parrot Foundation.
3
4use strict;
5use warnings;
6use lib qw( . lib ../lib ../../lib );
7use Test::More;
8use Parrot::Config;
9use Parrot::Test tests => 4;
10
11=head1 NAME
12
13t/compilers/imcc/syn/pod.t
14
15=head1 SYNOPSIS
16
17    % prove t/compilers/imcc/syn/pod.t
18
19=head1 DESCRIPTION
20
21Tests PIR's handling of Plain Old Documentation (POD) format.
22
23=cut
24
25
26pir_output_is( <<'CODE', <<'OUT', "simple pod" );
27.sub test :main
28    print "pass\n"
29    end
30.end
31=head1 Some POD
32This should be ignored, incl. digit 1
33CODE
34pass
35OUT
36
37pir_output_is( <<'CODE', <<'OUT', "pod with decimal digits" );
38.sub test :main
39    print "pass\n"
40    end
41.end
42=head1 Some POD
43This should be ignored, incl. number 1.0
44=cut
45CODE
46pass
47OUT
48
49pir_output_is( <<'CODE', <<'OUT', "pod inside sub" );
50.sub test :main
51     print "pass\n"
52     _x()
53     end
54.end
55
56.sub _x
57=head1 Some POD
58 This should be ignored, incl. digit 1.0
59=cut
60  print "ok\n"
61.end
62CODE
63pass
64ok
65OUT
66
67open my $FOO, ">", "include.tempfile";
68print $FOO <<'ENDF';
69
70=head1 Foobar
71
72we don't cut out!!!
73
74ENDF
75close $FOO;
76
77SKIP: {
78    skip( "Closing out of pod from included files", 1 );
79    pir_output_is( <<'CODE', <<'OUT', "simple pod" );
80.include "include.tempfile"
81.sub test :main
82    print "pass\n"
83    end
84.end
85CODE
86pass
87OUT
88}
89
90unlink( 'macro.tempfile', 'include.tempfile' );
91
92# Local Variables:
93#   mode: cperl
94#   cperl-indent-level: 4
95#   fill-column: 100
96# End:
97# vim: expandtab shiftwidth=4:
98