⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 metadata.t

📁 source of perl for linux application,
💻 T
📖 第 1 页 / 共 2 页
字号:
$dist->change_file( 'lib/Simple.pm', <<'---' );package Simple;$VERSION = '1.23';---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Simple;---$dist->regen( clean => 1 );$mb = new_build();is_deeply($mb->find_dist_packages,	  {'Simple' => { file => $simple_file,			 version => '1.23' }});$dist->remove_file( 'lib/Simple2.pm' );# Multiple files with same package,#   single version in non-corresponding package# Simple.pm  => Simple# Simple2.pm => Simple v1.23$dist->change_file( 'lib/Simple.pm', <<'---' );package Simple;---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Simple;$VERSION = '1.23';---$dist->regen( clean => 1 );$mb = new_build();is_deeply($mb->find_dist_packages,	  {'Simple' => { file => $simple2_file,			 version => '1.23' }});$dist->remove_file( 'lib/Simple2.pm' );# Multiple files with same package, conflicting versions# Simple.pm  => Simple v1.23# Simple2.pm => Simple v2.34$dist->change_file( 'lib/Simple.pm', <<'---' );package Simple;$VERSION = '1.23';---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Simple;$VERSION = '2.34';---$dist->regen( clean => 1 );$mb = new_build();$err = stderr_of( sub { $provides = $mb->find_dist_packages } );is_deeply($provides,	  {'Simple' => { file => $simple_file,			 version => '1.23' }});like( $err, qr/Found conflicting versions for package/,      '  with conflicting versions reported' );$dist->remove_file( 'lib/Simple2.pm' );# Multiple files with same package, multiple agreeing versions# Simple.pm  => Simple v1.23# Simple2.pm => Simple v1.23$dist->change_file( 'lib/Simple.pm', <<'---' );package Simple;$VERSION = '1.23';---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Simple;$VERSION = '1.23';---$dist->regen( clean => 1 );$mb = new_build();$err = stderr_of( sub { $provides = $mb->find_dist_packages } );is_deeply($provides,	  {'Simple' => { file => $simple_file,			 version => '1.23' }});$dist->remove_file( 'lib/Simple2.pm' );############################################################## (Same as above five cases except with non-corresponding package)## Multiple files with same package, no version# Simple.pm  => Foo# Simple2.pm => Foo$dist->change_file( 'lib/Simple.pm', <<'---' );package Foo;---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Foo;---$dist->regen( clean => 1 );$mb = new_build();$provides = $mb->find_dist_packages;ok( exists( $provides->{Foo} ) ); # it exist, can't predict which file$dist->remove_file( 'lib/Simple2.pm' );# Multiple files with same package, version in first file# Simple.pm  => Foo v1.23# Simple2.pm => Foo$dist->change_file( 'lib/Simple.pm', <<'---' );package Foo;$VERSION = '1.23';---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Foo;---$dist->regen( clean => 1 );$mb = new_build();is_deeply($mb->find_dist_packages,	  {'Foo' => { file => $simple_file,		      version => '1.23' }});$dist->remove_file( 'lib/Simple2.pm' );# Multiple files with same package, version in second file# Simple.pm  => Foo# Simple2.pm => Foo v1.23$dist->change_file( 'lib/Simple.pm', <<'---' );package Foo;---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Foo;$VERSION = '1.23';---$dist->regen( clean => 1 );$mb = new_build();is_deeply($mb->find_dist_packages,	  {'Foo' => { file => $simple2_file,		      version => '1.23' }});$dist->remove_file( 'lib/Simple2.pm' );# Multiple files with same package, conflicting versions# Simple.pm  => Foo v1.23# Simple2.pm => Foo v2.34$dist->change_file( 'lib/Simple.pm', <<'---' );package Foo;$VERSION = '1.23';---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Foo;$VERSION = '2.34';---$dist->regen( clean => 1 );$mb = new_build();$err = stderr_of( sub { $provides = $mb->find_dist_packages } );# XXX Should 'Foo' exist ??? Can't predict values for file & versionok( exists( $provides->{Foo} ) );like( $err, qr/Found conflicting versions for package/,      '  with conflicting versions reported' );$dist->remove_file( 'lib/Simple2.pm' );# Multiple files with same package, multiple agreeing versions# Simple.pm  => Foo v1.23# Simple2.pm => Foo v1.23$dist->change_file( 'lib/Simple.pm', <<'---' );package Foo;$VERSION = '1.23';---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Foo;$VERSION = '1.23';---$dist->regen( clean => 1 );$mb = new_build();$err = stderr_of( sub { $provides = $mb->find_dist_packages } );ok( exists( $provides->{Foo} ) );is( $provides->{Foo}{version}, '1.23' );ok( exists( $provides->{Foo}{file} ) ); # Can't predict which fileis( $err, '', '  no conflicts reported' );$dist->remove_file( 'lib/Simple2.pm' );############################################################# Conflicts among primary & multiple alternatives# multiple files, conflicting version in corresponding file$dist->change_file( 'lib/Simple.pm', <<'---' );package Simple;$VERSION = '1.23';---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Simple;$VERSION = '2.34';---$dist->add_file( 'lib/Simple3.pm', <<'---' );package Simple;$VERSION = '2.34';---$dist->regen( clean => 1 );$err = stderr_of( sub {  $mb = new_build();} );$err = stderr_of( sub { $provides = $mb->find_dist_packages } );is_deeply($provides,	  {'Simple' => { file => $simple_file,			 version => '1.23' }});like( $err, qr/Found conflicting versions for package/,      '  corresponding package conflicts with multiple alternatives' );$dist->remove_file( 'lib/Simple2.pm' );$dist->remove_file( 'lib/Simple3.pm' );# multiple files, conflicting version in non-corresponding file$dist->change_file( 'lib/Simple.pm', <<'---' );package Simple;$VERSION = '1.23';---$dist->add_file( 'lib/Simple2.pm', <<'---' );package Simple;$VERSION = '1.23';---$dist->add_file( 'lib/Simple3.pm', <<'---' );package Simple;$VERSION = '2.34';---$dist->regen( clean => 1 );$err = stderr_of( sub {  $mb = new_build();} );$err = stderr_of( sub { $provides = $mb->find_dist_packages } );is_deeply($provides,	  {'Simple' => { file => $simple_file,			 version => '1.23' }});like( $err, qr/Found conflicting versions for package/,      '  only one alternative conflicts with corresponding package' );$dist->remove_file( 'lib/Simple2.pm' );$dist->remove_file( 'lib/Simple3.pm' );############################################################# Don't record private packages (beginning with underscore)# Simple.pm => Simple::_private# Simple.pm => Simple::_private::too$dist->change_file( 'lib/Simple.pm', <<'---' );package Simple;$VERSION = '1.23';package Simple::_private;$VERSION = '2.34';package Simple::_private::too;$VERSION = '3.45';---$dist->regen( clean => 1 );$mb = new_build();is_deeply($mb->find_dist_packages,	  {'Simple' => { file => $simple_file,			 version => '1.23' }});############################################################# Files with no packages?# Simple.pm => <empty>$dist->change_file( 'lib/Simple.pm', '' );$dist->regen( clean => 1 );$mb = new_build();is_deeply( $mb->find_dist_packages, {} );# Simple.pm => =pod..=cut (no package declaration)$dist->change_file( 'lib/Simple.pm', <<'---' );=pod=head1 NAMESimple - Pure Documentation=head1 DESCRIPTIONDoesn't do anything.=cut---$dist->regen( clean => 1 );$mb = new_build();is_deeply($mb->find_dist_packages, {});############################################################# cleanupchdir( $cwd ) or die "Can't chdir to '$cwd': $!";$dist->remove;use File::Path;rmtree( $tmp );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -