Squeeze more flag manipulations together in sv_setsv_flags.
[p5sagit/p5-mst-13.2.git] / lib / Pod / t / text.t
CommitLineData
f011ec7d 1#!/usr/bin/perl -w
b7ae008f 2# $Id: text.t,v 1.3 2004/12/31 21:29:48 eagle Exp $
f011ec7d 3#
4# text.t -- Additional specialized tests for Pod::Text.
5#
b7ae008f 6# Copyright 2002, 2004 by Russ Allbery <rra@stanford.edu>
f011ec7d 7#
8# This program is free software; you may redistribute it and/or modify it
9# under the same terms as Perl itself.
10
11BEGIN {
12 chdir 't' if -d 't';
13 if ($ENV{PERL_CORE}) {
14 @INC = '../lib';
15 } else {
16 unshift (@INC, '../blib/lib');
17 }
18 unshift (@INC, '../blib/lib');
19 $| = 1;
b7ae008f 20 print "1..3\n";
f011ec7d 21}
22
23END {
24 print "not ok 1\n" unless $loaded;
25}
26
27use Pod::Text;
28
29$loaded = 1;
30print "ok 1\n";
31
32my $n = 2;
33while (<DATA>) {
34 next until $_ eq "###\n";
35 open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
36 while (<DATA>) {
37 last if $_ eq "###\n";
38 print TMP $_;
39 }
40 close TMP;
41 my $parser = Pod::Text->new or die "Cannot create parser\n";
42 $parser->parse_from_file ('tmp.pod', 'out.tmp');
b7ae008f 43 undef $parser;
f011ec7d 44 open (TMP, 'out.tmp') or die "Cannot open out.tmp: $!\n";
45 my $output;
46 {
47 local $/;
48 $output = <TMP>;
49 }
50 close TMP;
51 unlink ('tmp.pod', 'out.tmp');
52 my $expected = '';
53 while (<DATA>) {
54 last if $_ eq "###\n";
55 $expected .= $_;
56 }
57 if ($output eq $expected) {
58 print "ok $n\n";
59 } else {
60 print "not ok $n\n";
61 print "Expected\n========\n$expected\nOutput\n======\n$output\n";
62 }
63 $n++;
64}
65
66# Below the marker are bits of POD and corresponding expected text output.
67# This is used to test specific features or problems with Pod::Text. The
68# input and output are separated by lines containing only ###.
69
70__DATA__
71
72###
73=head1 PERIODS
74
75This C<.> should be quoted.
76###
77PERIODS
78 This "." should be quoted.
79
80###
b7ae008f 81
82###
83=head1 CE<lt>E<gt> WITH SPACES
84
85What does C<< this. >> end up looking like?
86###
87C<> WITH SPACES
88 What does "this." end up looking like?
89
90###