my $output = $args{command_output};
my $string;
if (defined $output) {
- ($string) = $output =~ /^valgrind-([0-9]+(?:\.[0-9]+)*)(?!\.)/;
+ ($string) = $output =~ /^valgrind-([0-9]+(?:\.[0-9]+)*)/;
} else {
$string = $args{string};
return $string if $string->$instanceof(__PACKAGE__);
- if (defined $string and $string =~ /^([0-9]+(?:\.[0-9]+)*)(?!\.)/) {
+ if (defined $string and $string =~ /^([0-9]+(?:\.[0-9]+)*)/) {
$string = $1;
} else {
$string = undef;
use strict;
use warnings;
-use Test::More tests => 6 + 6 + 2 * 5 + 2 * 5 + 2 * 21 + 2 * 14;
+use Test::More tests => 6 + 5 + 4 * 8 + 2 * 21 + 2 * 14;
use Test::Valgrind::Version;
undef,
'valgrind',
'valgrind-1.2.3',
- '1.',
- '1.2.',
- '1.2.a',
+ 'abc',
+ 'd.e.f',
);
for my $failure (@string_failures) {
'valgrind-1.2.3' => '1.2.3',
'valgrind-1.2.4-rc5' => '1.2.4',
'valgrind-1.2.6a' => '1.2.6',
+ 'valgrind-1.2.7.' => '1.2.7',
+ 'valgrind-1.2.x.8' => '1.2.0',
+ 'valgrind-1.10.' => '1.10.0',
);
my @string_valid = map { my $s = $_; $s =~ s/^valgrind-//; $s }