mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-14 15:33:49 +00:00
fixed various test issues - 1365085
This commit is contained in:
@@ -75,6 +75,8 @@ SKIP: {
|
||||
unless $root eq $trunk;
|
||||
|
||||
my @tags = split /\n/, `$bzr tags`;
|
||||
# sort the version numbers (some bzr versions do not sort them)
|
||||
@tags = sort { calc_value($a) <=> calc_value($b) } @tags;
|
||||
my ($current_tag) = $tags[-1] =~ /^(\S+)/;
|
||||
|
||||
is(
|
||||
@@ -84,4 +86,18 @@ SKIP: {
|
||||
);
|
||||
}
|
||||
|
||||
# we use this function to help sort version numbers
|
||||
sub calc_value {
|
||||
my $version = shift;
|
||||
$version =~ s/ +[^ ]*$//;
|
||||
my $value = 0;
|
||||
my $exp = 0;
|
||||
foreach my $num (reverse split /\./, $version) {
|
||||
$value += $num * 10 ** $exp++;
|
||||
}
|
||||
print "$version = $value\n";
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user