#!/usr/bin/perl -w
-# $Id: man.t,v 1.10 2006-09-16 20:25:25 eagle Exp $
#
# man.t -- Additional specialized tests for Pod::Man.
#
-# Copyright 2002, 2003, 2004, 2006 by Russ Allbery <rra@stanford.edu>
+# Copyright 2002, 2003, 2004, 2006, 2007, 2008
+# Russ Allbery <rra@stanford.edu>
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
}
unshift (@INC, '../blib/lib');
$| = 1;
- print "1..21\n";
+ print "1..25\n";
}
END {
$loaded = 1;
print "ok 1\n";
-my $have_encoding = eval { require PerlIO::encoding; 1; } && ! $@;
+# Test whether we can use binmode to set encoding.
+my $have_encoding = (eval { require PerlIO::encoding; 1 } and not $@);
my $parser = Pod::Man->new or die "Cannot create parser\n";
my $n = 2;
open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
# We have a test in ISO 8859-1 encoding. Make sure that nothing strange
- # happens if Perl thinks the world is Unicode.
- binmode (\*TMP, ':encoding(iso-8859-1)') if $have_encoding;
+ # happens if Perl thinks the world is Unicode. Wrap this in eval so that
+ # older versions of Perl don't croak.
+ eval { binmode (\*TMP, ':encoding(iso-8859-1)') if $have_encoding };
while (<DATA>) {
last if $_ eq "###\n";
- no warnings 'utf8';
print TMP $_;
}
close TMP;
###
.SH "NAME"
"Stuff" (no guesswork)
-.Sh "\s-1THINGS\s0"
+.SS "\s-1THINGS\s0"
.IX Subsection "THINGS"
Oboy, is this \*(C+ \*(L"fun\*(R" yet! (guesswork)
###
###
.SH "Newline C Quote Weirdness"
.IX Header "Newline C Quote Weirdness"
-Blorp \f(CW'
-\&''\fR. Yes.
+Blorp \f(CW\*(Aq
+\&\*(Aq\*(Aq\fR. Yes.
###
###
Don't transform\ even-this\ hyphen. This \*(L"one's-fine!\*(R", as well. However,
$\-0.13 should have a real hyphen.
###
+
+###
+=head1 Quote escaping
+
+Don't escape `this' but do escape C<`this'> (and don't surround it in quotes).
+###
+.SH "Quote escaping"
+.IX Header "Quote escaping"
+Don't escape `this' but do escape \f(CW\`this\*(Aq\fR (and don't surround it in quotes).
+###
+
+###
+=pod
+
+E<eth>
+###
+.PP
+\&\*(d-
+###
+
+###
+=head1 C<one> and C<two>
+###
+.ie n .SH """one"" and ""two"""
+.el .SH "\f(CWone\fP and \f(CWtwo\fP"
+.IX Header "one and two"
+###
+
+###
+=pod
+
+Some text.
+
+=for man
+Some raw nroff.
+
+=for roff \fBBold text.\fP
+
+=for html
+Stuff that's hidden.
+
+=for MAN \fIItalic text.\fP
+
+=for ROFF
+.PP
+\&A paragraph.
+
+More text.
+###
+Some text.
+Some raw nroff.
+\fBBold text.\fP
+\fIItalic text.\fP
+.PP
+\&A paragraph.
+.PP
+More text.
+###