Re: [Module::Build] M::B and version.pm
Status: Beta
Brought to you by:
kwilliams
|
From: John P. <jpe...@ro...> - 2006-02-22 20:40:36
|
David E. Wheeler wrote:
> Okay, but there does seem to be a conversion problem. Witness this test:
>
> use strict;
> use version;
> use Test::More tests => 1;
>
> my $v = version->new('0.0.1');
> my $nv = version->new($v->numify);
> is $nv, $v;
>
> The output:
>
> 1..1
> not ok 1
> # Failed test in /Users/david/bin/try at line 8.
> # got: '0.000001'
> # expected: 'v0.0.1'
> # Looks like you failed 1 test of 1.
>
> Shouldn't they be the same?
Nope. is() performs an implicit stringification of each term and then
performs a string comparison (i.e. no overload magic possible). Replace
that last line with:
cmp_ok( $nv,'==', $v);
and it will work as you expected. No, I don't like it, but I don't have
any choice...
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5748
|