r29688 - in /branches/upstream/libparse-cpan-meta-perl/current: ./ lib/Parse/CPAN/ t/ t/lib/ t/lib/Parse/ t/lib/Parse/CPAN/ t/lib/Parse/CPAN/Meta/

bricas-guest at users.alioth.debian.org bricas-guest at users.alioth.debian.org
Thu Jan 15 23:21:00 UTC 2009


Author: bricas-guest
Date: Thu Jan 15 23:20:57 2009
New Revision: 29688

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=29688
Log:
[svn-upgrade] Integrating new upstream version, libparse-cpan-meta-perl (0.04)

Added:
    branches/upstream/libparse-cpan-meta-perl/current/t/lib/Parse/
    branches/upstream/libparse-cpan-meta-perl/current/t/lib/Parse/CPAN/
    branches/upstream/libparse-cpan-meta-perl/current/t/lib/Parse/CPAN/Meta/
    branches/upstream/libparse-cpan-meta-perl/current/t/lib/Parse/CPAN/Meta/Test.pm
Removed:
    branches/upstream/libparse-cpan-meta-perl/current/LICENSE
    branches/upstream/libparse-cpan-meta-perl/current/README
    branches/upstream/libparse-cpan-meta-perl/current/t/97_meta.t
    branches/upstream/libparse-cpan-meta-perl/current/t/98_pod.t
    branches/upstream/libparse-cpan-meta-perl/current/t/99_pmv.t
    branches/upstream/libparse-cpan-meta-perl/current/t/lib/Test.pm
Modified:
    branches/upstream/libparse-cpan-meta-perl/current/Changes
    branches/upstream/libparse-cpan-meta-perl/current/MANIFEST
    branches/upstream/libparse-cpan-meta-perl/current/META.yml
    branches/upstream/libparse-cpan-meta-perl/current/Makefile.PL
    branches/upstream/libparse-cpan-meta-perl/current/lib/Parse/CPAN/Meta.pm
    branches/upstream/libparse-cpan-meta-perl/current/t/01_compile.t
    branches/upstream/libparse-cpan-meta-perl/current/t/02_basic.t
    branches/upstream/libparse-cpan-meta-perl/current/t/03_regression.t
    branches/upstream/libparse-cpan-meta-perl/current/t/04_scalar.t
    branches/upstream/libparse-cpan-meta-perl/current/t/11_meta_yml.t
    branches/upstream/libparse-cpan-meta-perl/current/t/12_plagger.t
    branches/upstream/libparse-cpan-meta-perl/current/t/13_perl_smith.t
    branches/upstream/libparse-cpan-meta-perl/current/t/14_yaml_org.t
    branches/upstream/libparse-cpan-meta-perl/current/t/15_multibyte.t
    branches/upstream/libparse-cpan-meta-perl/current/t/16_nullrefs.t
    branches/upstream/libparse-cpan-meta-perl/current/t/17_toolbar.t

Modified: branches/upstream/libparse-cpan-meta-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/Changes?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/Changes (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/Changes Thu Jan 15 23:20:57 2009
@@ -1,4 +1,9 @@
-Revision history for Perl extension Parse::CPAN::Meta
+Revision history for Perl extension Parse-CPAN-Meta
+
+0.04 Wed  7 Jan 2009
+	- Matching changes in YAML::Tiny 1.36
+	- Fixing missing feature reported by H.Merijn Brand
+	- Changes to make Padre-CPAN-Meta core-compatible (SMUELLER)++
 
 0.03 Thu 20 Mar 2008
 	- Adding YAML.pm compatibility in scalar context

Modified: branches/upstream/libparse-cpan-meta-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/MANIFEST?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/MANIFEST (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/MANIFEST Thu Jan 15 23:20:57 2009
@@ -1,9 +1,7 @@
 Changes
 lib/Parse/CPAN/Meta.pm
-LICENSE
 Makefile.PL
 MANIFEST			This list of files
-README
 t/01_compile.t
 t/02_basic.t
 t/03_regression.t
@@ -15,14 +13,11 @@
 t/15_multibyte.t
 t/16_nullrefs.t
 t/17_toolbar.t
-t/97_meta.t
-t/98_pod.t
-t/99_pmv.t
 t/data/HTML-WebDAO.yml
 t/data/multibyte.yml
 t/data/sample.yml
 t/data/Template-Provider-Unicode-Japanese.yml
 t/data/toolbar.yml
 t/data/vanilla.yml
-t/lib/Test.pm
+t/lib/Parse/CPAN/Meta/Test.pm
 META.yml                                 Module meta-data (added by MakeMaker)

Modified: branches/upstream/libparse-cpan-meta-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/META.yml?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/META.yml (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/META.yml Thu Jan 15 23:20:57 2009
@@ -1,11 +1,11 @@
 --- #YAML:1.0
 name:                Parse-CPAN-Meta
-version:             0.03
+version:             0.04
 abstract:            Parse META.yml and other similar CPAN metadata files
 license:             perl
 author:              
     - Adam Kennedy <adamk at cpan.org>
-generated_by:        ExtUtils::MakeMaker version 6.42
+generated_by:        ExtUtils::MakeMaker version 6.44
 distribution_type:   module
 requires:     
     File::Spec:                    0.80

Modified: branches/upstream/libparse-cpan-meta-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/Makefile.PL?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/Makefile.PL (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/Makefile.PL Thu Jan 15 23:20:57 2009
@@ -1,7 +1,7 @@
 use strict;
 BEGIN {
 	require 5.003_96;
-	$main::VERSION = '0.03';
+	$main::VERSION = '0.04';
 }
 use ExtUtils::MakeMaker;
 

Modified: branches/upstream/libparse-cpan-meta-perl/current/lib/Parse/CPAN/Meta.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/lib/Parse/CPAN/Meta.pm?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/lib/Parse/CPAN/Meta.pm (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/lib/Parse/CPAN/Meta.pm Thu Jan 15 23:20:57 2009
@@ -5,7 +5,7 @@
 BEGIN {
 	require 5.004;
 	require Exporter;
-	$Parse::CPAN::Meta::VERSION   = '0.03';
+	$Parse::CPAN::Meta::VERSION   = '0.04';
 	@Parse::CPAN::Meta::ISA       = qw{ Exporter      };
 	@Parse::CPAN::Meta::EXPORT_OK = qw{ Load LoadFile };
 }
@@ -227,6 +227,16 @@
 				croak("Parse::CPAN::Meta does not support the line '$lines->[0]'");
 			}
 
+		} elsif ( defined $indent->[-2] and $indent->[-1] == $indent->[-2] ) {
+			# This is probably a structure like the following...
+			# ---
+			# foo:
+			# - list
+			# bar: value
+			#
+			# ... so lets return and let the hash parser handle it
+			return 1;
+
 		} else {
 			croak("Parse::CPAN::Meta does not support the line '$lines->[0]'");
 		}
@@ -377,7 +387,7 @@
 
 =head1 COPYRIGHT
 
-Copyright 2006 - 2008 Adam Kennedy.
+Copyright 2006 - 2009 Adam Kennedy.
 
 This program is free software; you can redistribute
 it and/or modify it under the same terms as Perl itself.

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/01_compile.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/01_compile.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/01_compile.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/01_compile.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Load testing for YAML::Tiny
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {
@@ -16,4 +26,4 @@
 
 # Does the module load
 use_ok( 'Parse::CPAN::Meta' );
-use_ok( 't::lib::Test' );
+use_ok( 'Parse::CPAN::Meta::Test' );

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/02_basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/02_basic.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/02_basic.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/02_basic.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Testing of basic document structures
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {
@@ -9,7 +19,7 @@
 }
 
 use File::Spec::Functions ':ALL';
-use t::lib::Test;
+use Parse::CPAN::Meta::Test;
 use Test::More tests(30);
 
 

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/03_regression.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/03_regression.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/03_regression.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/03_regression.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Testing of common META.yml examples
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {
@@ -9,8 +19,8 @@
 }
 
 use File::Spec::Functions ':ALL';
-use t::lib::Test;
-use Test::More tests(19);
+use Parse::CPAN::Meta::Test;
+use Test::More tests(20);
 
 
 
@@ -280,3 +290,22 @@
 	[ { foo => "foo\\\n\tbar" } ],
 	'special characters',
 );
+
+
+
+
+
+
+######################################################################
+# Non-Indenting Sub-List
+
+yaml_ok(
+	<<'END_YAML',
+---
+foo:
+- list
+bar: value
+END_YAML
+	[ { foo => [ 'list' ], bar => 'value' } ],
+	'Non-indenting sub-list',
+);

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/04_scalar.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/04_scalar.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/04_scalar.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/04_scalar.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Testing of basic document structures
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/11_meta_yml.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/11_meta_yml.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/11_meta_yml.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/11_meta_yml.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Testing of common META.yml examples
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {
@@ -9,7 +19,7 @@
 }
 
 use File::Spec::Functions ':ALL';
-use t::lib::Test;
+use Parse::CPAN::Meta::Test;
 use Test::More tests(8, 2);
 
 
@@ -255,7 +265,7 @@
 SCOPE: {
 	my $content = load_ok(
 		'Template-Provider-Unicode-Japanese.yml',
-		catfile( 't', 'data', 'Template-Provider-Unicode-Japanese.yml' ),
+		catfile( test_data_directory(), 'Template-Provider-Unicode-Japanese.yml' ),
 		100
 	);
 	yaml_ok(
@@ -289,7 +299,7 @@
 SCOPE: {
 	my $content = load_ok(
 		'HTML-WebDAO.yml',
-		catfile( 't', 'data', 'HTML-WebDAO.yml' ),
+		catfile( test_data_directory(), 'HTML-WebDAO.yml' ),
 		100
 	);
 	yaml_ok(

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/12_plagger.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/12_plagger.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/12_plagger.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/12_plagger.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Testing Plagger config samples from Miyagawa-san's YAPC::NA 2006 talk
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {
@@ -9,7 +19,7 @@
 }
 
 use File::Spec::Functions ':ALL';
-use t::lib::Test;
+use Parse::CPAN::Meta::Test;
 use Test::More tests(2);
 
 

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/13_perl_smith.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/13_perl_smith.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/13_perl_smith.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/13_perl_smith.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Testing of common META.yml examples
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {
@@ -9,7 +19,7 @@
 }
 
 use File::Spec::Functions ':ALL';
-use t::lib::Test;
+use Parse::CPAN::Meta::Test;
 use Test::More tests(1, 1);
 
 
@@ -19,7 +29,7 @@
 #####################################################################
 # Testing that Perl::Smith config files work
 
-my $vanilla_file = catfile( 't', 'data', 'vanilla.yml' );
+my $vanilla_file = catfile( test_data_directory(), 'vanilla.yml' );
 my $vanilla      = load_ok( 'yanilla.yml', $vanilla_file, 1000 );
 
 yaml_ok(

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/14_yaml_org.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/14_yaml_org.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/14_yaml_org.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/14_yaml_org.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Testing of common META.yml examples
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {
@@ -9,7 +19,7 @@
 }
 
 use File::Spec::Functions ':ALL';
-use t::lib::Test;
+use Parse::CPAN::Meta::Test;
 use Test::More tests(1, 1);
 
 
@@ -19,7 +29,7 @@
 #####################################################################
 # Testing that Perl::Smith config files work
 
-my $sample_file = catfile( 't', 'data', 'sample.yml' );
+my $sample_file = catfile( test_data_directory(), 'sample.yml' );
 my $sample      = load_ok( 'sample.yml', $sample_file, 500 );
 
 yaml_ok(

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/15_multibyte.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/15_multibyte.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/15_multibyte.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/15_multibyte.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Testing of META.yml containing AVAR's name
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {
@@ -9,7 +19,7 @@
 }
 
 use File::Spec::Functions ':ALL';
-use t::lib::Test;
+use Parse::CPAN::Meta::Test;
 use Test::More tests(0, 1, 3);
 
 
@@ -19,7 +29,7 @@
 #####################################################################
 # Testing that Perl::Smith config files work
 
-my $sample_file = catfile( 't', 'data', 'multibyte.yml' );
+my $sample_file = catfile( test_data_directory(), 'multibyte.yml' );
 my $sample      = load_ok( 'multibyte.yml', $sample_file, 450 );
 
 # Does the string parse to the structure

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/16_nullrefs.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/16_nullrefs.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/16_nullrefs.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/16_nullrefs.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Testing for null references
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {
@@ -9,7 +19,7 @@
 }
 
 use File::Spec::Functions ':ALL';
-use t::lib::Test;
+use Parse::CPAN::Meta::Test;
 use Test::More tests(1);
 
 

Modified: branches/upstream/libparse-cpan-meta-perl/current/t/17_toolbar.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/17_toolbar.t?rev=29688&op=diff
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/17_toolbar.t (original)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/17_toolbar.t Thu Jan 15 23:20:57 2009
@@ -1,6 +1,16 @@
 #!/usr/bin/perl
 
 # Testing of a known-bad file from an editor
+
+BEGIN {
+	if( $ENV{PERL_CORE} ) {
+		chdir 't';
+		@INC = ('../lib', 'lib');
+	}
+	else {
+		unshift @INC, 't/lib/';
+	}
+}
 
 use strict;
 BEGIN {
@@ -9,7 +19,7 @@
 }
 
 use File::Spec::Functions ':ALL';
-use t::lib::Test;
+use Parse::CPAN::Meta::Test;
 # use Test::More skip_all => 'Temporarily ignoring failing test';
 use Test::More tests(1, 1);
 
@@ -20,7 +30,7 @@
 #####################################################################
 # Testing that Perl::Smith config files work
 
-my $toolbar_file = catfile( 't', 'data', 'toolbar.yml' );
+my $toolbar_file = catfile( test_data_directory(), 'toolbar.yml' );
 my $toolbar      = load_ok( 'toolbar.yml', $toolbar_file, 100 );
 
 yaml_ok(

Added: branches/upstream/libparse-cpan-meta-perl/current/t/lib/Parse/CPAN/Meta/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparse-cpan-meta-perl/current/t/lib/Parse/CPAN/Meta/Test.pm?rev=29688&op=file
==============================================================================
--- branches/upstream/libparse-cpan-meta-perl/current/t/lib/Parse/CPAN/Meta/Test.pm (added)
+++ branches/upstream/libparse-cpan-meta-perl/current/t/lib/Parse/CPAN/Meta/Test.pm Thu Jan 15 23:20:57 2009
@@ -1,0 +1,77 @@
+package Parse::CPAN::Meta::Test;
+
+use strict;
+use Test::More ();
+use Parse::CPAN::Meta;
+use File::Spec;
+
+use vars qw{@ISA @EXPORT};
+BEGIN {
+	require Exporter;
+	@ISA    = qw{ Exporter };
+	@EXPORT = qw{ tests  yaml_ok  slurp  load_ok  test_data_directory };
+}
+
+sub test_data_directory {
+	return(
+		$ENV{PERL_CORE}
+		? File::Spec->catdir(File::Spec->updir, qw(lib Parse CPAN Meta t data))
+		: File::Spec->catdir(qw(t data))
+	);
+}
+
+# 22 tests per call to yaml_ok
+# 4  tests per call to load_ok
+sub tests {
+	return ( tests => count(@_) );
+}
+
+sub count {
+	my $yaml_ok = shift || 0;
+	my $load_ok = shift || 0;
+	my $single  = shift || 0;
+	my $count   = $yaml_ok * 3 + $load_ok * 4 + $single;
+	return $count;
+}
+
+sub yaml_ok {
+	my $string  = shift;
+	my $array   = shift;
+	my $name    = shift || 'unnamed';
+
+	# Does the string parse to the structure
+	my $yaml_copy = $string;
+	my @yaml      = eval { Parse::CPAN::Meta::Load( $yaml_copy ); };
+	Test::More::is( $@, '', "$name: Parse::CPAN::Meta parses without error" );
+	Test::More::is( $yaml_copy, $string, "$name: Parse::CPAN::Meta does not modify the input string" );
+	SKIP: {
+		Test::More::skip( "Shortcutting after failure", 1 ) if $@;
+		Test::More::is_deeply( \@yaml, $array, "$name: Parse::CPAN::Meta parses correctly" );
+	}
+
+	# Return true as a convenience
+	return 1;
+}
+
+sub slurp {
+	my $file = shift;
+	local $/ = undef;
+	open( FILE, " $file" ) or die "open($file) failed: $!";
+	my $source = <FILE>;
+	close( FILE ) or die "close($file) failed: $!";
+	$source;
+}
+
+sub load_ok {
+	my $name = shift;
+	my $file = shift;
+	my $size = shift;
+	Test::More::ok( -f $file, "Found $name" ) or Test::More::diag("Searched at '$file'");
+	Test::More::ok( -r $file, "Can read $name" );
+	my $content = slurp( $file );
+	Test::More::ok( (defined $content and ! ref $content), "Loaded $name" );
+	Test::More::ok( ($size < length $content), "Content of $name larger than $size bytes" );
+	return $content;
+}
+
+1;




More information about the Pkg-perl-cvs-commits mailing list