📄 pod_parser.t
字号:
#!/usr/bin/perl -wuse strict;use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';use MBTest tests => 7;use Cwd ();my $cwd = Cwd::cwd;#########################use_ok 'Module::Build::PodParser';{ package IO::StringBased; sub TIEHANDLE { my ($class, $string) = @_; return bless { data => [ map "$_\n", split /\n/, $string], }, $class; } sub READLINE { shift @{ shift()->{data} }; }}local *FH;tie *FH, 'IO::StringBased', <<'EOF';=head1 NAMEFoo::Bar - Perl extension for blah blah blah=head1 AUTHORC<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.Home page: http://example.com/~eh/=cutEOFmy $pp = Module::Build::PodParser->new(fh => \*FH);ok $pp, 'object created';is $pp->get_author->[0], 'C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.', 'author';is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract';{ # Try again without a valid author spec untie *FH; tie *FH, 'IO::StringBased', <<'EOF';=head1 NAMEFoo::Bar - Perl extension for blah blah blah=cutEOF my $pp = Module::Build::PodParser->new(fh => \*FH); ok $pp, 'object created'; is_deeply $pp->get_author, [], 'author'; is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract';}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -