Permalink
Browse files

[config] Fix TT#1849, where a released versions git describe string w…

…as not recognized
  • Loading branch information...
1 parent 7dbc0aa commit 4820ad51b936d2a90639e8b4ef512a66b40bdc1f @leto leto committed Nov 16, 2010
Showing with 16 additions and 2 deletions.
  1. +1 −1 config/auto/git_describe.pm
  2. +15 −1 t/steps/auto/git_describe-01.t
@@ -33,7 +33,7 @@ sub runstep {
my $describe = $Parrot::Git::Describe::current;
- if ( defined($describe) and $describe !~ /^REL(EASE)?_\d+_\d+_\d+-\d+-g[0-9A-Fa-f]{7}$/ ) {
+ if ( defined($describe) and $describe !~ /^REL(EASE)?_\d+_\d+_\d+(-\d+-g[0-9A-Fa-f]{7})?$/ ) {
die "Invalid git describe string (Git::Describe): $describe";
}
@@ -4,7 +4,7 @@
use strict;
use warnings;
-use Test::More tests => 12;
+use Test::More tests => 14;
use Carp;
use lib qw( lib t/configure/testlib );
use_ok('config::auto::git_describe');
@@ -71,6 +71,20 @@ $conf->replenish($serialized);
$conf->data->set( git_describe => undef ); # prepare for next test
}
+$conf->replenish($serialized);
+
+{
+ no warnings 'once';
+ my $cur = 'RELEASE_2_10_0';
+ local $Parrot::Git::Describe::current = $cur;
+ my $ret = $step->runstep($conf);
+ ok( $ret, "runstep() returned true value" );
+ is($step->result(), $cur,
+ "Got expected result for valid \$Parrot::Git::Describe::current"
+ );
+ $conf->data->set( git_describe => undef ); # prepare for next test
+}
+
pass("Completed all tests in $0");

0 comments on commit 4820ad5

Please sign in to comment.