📄 man.t
字号:
#!/usr/bin/perl -w# $Id: man.t,v 1.12 2007-11-29 01:35:54 eagle Exp $## man.t -- Additional specialized tests for Pod::Man.## Copyright 2002, 2003, 2004, 2006, 2007 by 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.BEGIN { chdir 't' if -d 't'; if ($ENV{PERL_CORE}) { @INC = '../lib'; } else { unshift (@INC, '../blib/lib'); } unshift (@INC, '../blib/lib'); $| = 1; print "1..22\n";}END { print "not ok 1\n" unless $loaded;}use Pod::Man;$loaded = 1;print "ok 1\n";my $parser = Pod::Man->new or die "Cannot create parser\n";my $n = 2;while (<DATA>) { next until $_ eq "###\n"; 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. Wrap this in eval so that # older versions of Perl don't croak. eval { binmode (\*TMP, ':encoding(iso-8859-1)') }; while (<DATA>) { last if $_ eq "###\n"; print TMP $_; } close TMP; open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n"; $parser->parse_from_file ('tmp.pod', \*OUT); close OUT; open (OUT, 'out.tmp') or die "Cannot open out.tmp: $!\n"; while (<OUT>) { last if /^\.nh/ } my $output; { local $/; $output = <OUT>; } close OUT; unlink ('tmp.pod', 'out.tmp'); my $expected = ''; while (<DATA>) { last if $_ eq "###\n"; $expected .= $_; } if ($output eq $expected) { print "ok $n\n"; } else { print "not ok $n\n"; print "Expected\n========\n$expected\nOutput\n======\n$output\n"; } $n++;}# Below the marker are bits of POD and corresponding expected nroff output.# This is used to test specific features or problems with Pod::Man. The input# and output are separated by lines containing only ###.__DATA__###=head1 NAMEgcc - GNU project C and C++ compiler=head1 C++ NOTESOther mentions of C++.###.SH "NAME"gcc \- GNU project C and C++ compiler.SH "\*(C+ NOTES".IX Header " NOTES"Other mentions of \*(C+.######=head1 PERIODSThis C<.> should be quoted.###.SH "PERIODS".IX Header "PERIODS"This \f(CW\*(C`.\*(C'\fR should be quoted.######=over 4=item *A bullet.=item *Another bullet.=item * Also a bullet.=back###.IP "\(bu" 4A bullet..IP "\(bu" 4Another bullet..IP "\(bu" 4Also a bullet.######=over 4=item fooNot a bullet.=item *Also not a bullet.=back###.IP "foo" 4.IX Item "foo"Not a bullet..IP "*" 4Also not a bullet.######=encoding iso-8859-1=head1 ACCENTSBeyonc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -