Mercurial > hg > nginx-tests
changeset 284:8fcc46212e5e
Tests: fix has_version() to handle previous branch checks.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 11 May 2013 20:24:49 +0400 |
parents | 36d24870ccb2 |
children | 484b713f57b0 |
files | lib/Test/Nginx.pm |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/Test/Nginx.pm Sat May 11 20:09:31 2013 +0400 +++ b/lib/Test/Nginx.pm Sat May 11 20:24:49 2013 +0400 @@ -130,10 +130,12 @@ $self->{_configure_args} =~ m!nginx version: nginx/([0-9.]+)!; my @v = split(/\./, $1); - my $n; + my ($n, $v); for $n (split(/\./, $need)) { - return 0 if $n > (shift @v || 0); + $v = shift @v || 0; + return 0 if $n > $v; + return 1 if $v > $n; } return 1;