On Feb 14, 2006, at 5:22 AM, John Peacock wrote:
> Andreas J. Koenig wrote:
>> The following test is broken in bleadperl:
>>
>> my $fh = IO::File->new(File::Spec->catfile($dist->dirname,
>> 'META.yml'));
>> my $contents = do {local $/; <$fh>};
>> $contents =~ /Module::Build version ([0-9_.]+)/m;
>> is $1, $mb->VERSION, "Check version used to create META.yml: $1 ==
>> " . $mb->VERSION;
>>
>> The last line should compensate for trailing zeroes:
>>
>> is 0+$1, 0+$mb->VERSION, "Check version used to create META.yml: $1
>> == " . $mb->VERSION;
>
> Or better yet, stop doing *string* comparison with *numbers* (or
> $VERSION's):
In my defense, all I was doing is setting a variable and checking its
value later after it passed through a file, so the natural comparison
seemed to be a string comparison.
In any case, I'm checking in the first part of the patch now, before I
start thinking about the other parts.
-Ken
Index: t/runthrough.t
===================================================================
RCS file: /cvsroot/module-build/Module-Build/t/runthrough.t,v
retrieving revision 1.64
diff -u -r1.64 runthrough.t
--- t/runthrough.t 9 Jan 2006 03:58:01 -0000 1.64
+++ t/runthrough.t 16 Feb 2006 04:05:09 -0000
@@ -139,7 +139,7 @@
my $fh = IO::File->new(File::Spec->catfile($dist->dirname,
'META.yml'));
my $contents = do {local $/; <$fh>};
$contents =~ /Module::Build version ([0-9_.]+)/m;
- is $1, $mb->VERSION, "Check version used to create META.yml: $1 == "
. $mb->VERSION;
+ cmp_ok $1, '==', $mb->VERSION, "Check version used to create
META.yml: $1 == " . $mb->VERSION;
SKIP: {
skip( "not sure if we can create a tarball on this platform", 1 )
|