use strict;
use warnings;
-use Test::More tests => 6 * ((8 * 7) / 2);
+use Test::More tests => 2 * 5 * ((8 * 7) / 2);
use CPANPLUS::Dist::Gentoo::Atom;
my $desc = join " $cmp ", map "'$_'", $a, $b;
- my $c = eval "\$a $cmp \$b";
- my $err = $@;
+ my ($err, $c);
+ {
+ local $@;
+ $c = eval "\$a $cmp \$b";
+ $err = $@;
+ }
if (ref $exp eq 'Regexp') {
like $err, $exp, "$desc should fail";
}
compare_ok($a, '<=>', $b, $exp);
- compare_ok($a, '<=>', "$b", $exp);
+
+ my $bs = "$b";
+ compare_ok($a, '<=>', $bs, $exp);
+
+ if (my $bv = $b->version) {
+ compare_ok($a, '<=>', $bv, $exp);
+ compare_ok($a, '<=>', "$bv", $exp);
+ } else {
+ pass("$bs has no version part ($_)") for 1, 2;
+ }
+
compare_ok($a, 'cmp', $b, $exp);
}
}