From 72287d960b27266568e4ac3e7defc1c830eec00b Mon Sep 17 00:00:00 2001 From: John Peacock Date: Wed, 24 Oct 2007 18:04:45 -0400 Subject: [PATCH] Bring version.pm core into compliance with CPAN release Message-ID: <471FF9BD.40204@havurah-software.org> p4raw-id: //depot/perl@32189 --- lib/version.pm | 2 +- lib/version.t | 11 +++++++++++ util.c | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/version.pm b/lib/version.pm index 7a3f14b..f05d20a 100644 --- a/lib/version.pm +++ b/lib/version.pm @@ -6,7 +6,7 @@ use strict; use vars qw(@ISA $VERSION $CLASS *qv); -$VERSION = 0.73; +$VERSION = 0.74; $CLASS = 'version'; diff --git a/lib/version.t b/lib/version.t index 9d0554c..a839d5d 100644 --- a/lib/version.t +++ b/lib/version.t @@ -5,6 +5,7 @@ ######################### use Test::More qw(no_plan); +use Data::Dumper; require Test::Harness; no warnings 'once'; *Verbose = \$Test::Harness::Verbose; @@ -541,6 +542,16 @@ SKIP: { like($warning, qr/Integer overflow in version/, "Too large version"); } + { + # http://rt.cpan.org/Public/Bug/Display.html?id=30004 + my $v1 = $CLASS->new("v0.1_1"); + (my $alpha1 = Dumper($v1)) =~ s/.+'alpha' => ([^,]+),.+/$1/ms; + my $v2 = $CLASS->new($v1); + (my $alpha2 = Dumper($v2)) =~ s/.+'alpha' => ([^,]+),.+/$1/ms; + is $alpha2, $alpha1, "Don't fall for Data::Dumper's tricks"; + } + + } 1; diff --git a/util.c b/util.c index f75e5a7..670c823 100644 --- a/util.c +++ b/util.c @@ -4395,10 +4395,10 @@ Perl_new_version(pTHX_ SV *ver) /* Begin copying all of the elements */ if ( hv_exists((HV *)ver, "qv", 2) ) - (void)hv_stores((HV *)hv, "qv", &PL_sv_yes); + (void)hv_stores((HV *)hv, "qv", newSViv(1)); if ( hv_exists((HV *)ver, "alpha", 5) ) - (void)hv_stores((HV *)hv, "alpha", &PL_sv_yes); + (void)hv_stores((HV *)hv, "alpha", newSViv(1)); if ( hv_exists((HV*)ver, "width", 5 ) ) { -- 2.7.4