diff options
Diffstat (limited to 't')
-rw-r--r-- | t/99-versioning.t | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/t/99-versioning.t b/t/99-versioning.t index d7ce0126..e760daee 100644 --- a/t/99-versioning.t +++ b/t/99-versioning.t @@ -27,6 +27,20 @@ is($form->{version}, $ver, 'Form version matches VERSION'); SKIP: { skip 'Form is trunk', 1 if $form->{version} =~ /trunk$/i; - cmp_ok($form->{version}, 'ge', $form->{dbversion}, - 'form: version >= dbversion'); + my @dparts = split /\./, $form->{dbversion}; + my @lparts = split /\./, $form->{version}; + my $age = 0; + foreach my $dpart (@dparts) { + my $lpart = shift @lparts; + if (!defined $lpart) { + $age = 1; + last; + } elsif ($lpart > $dpart) { + last; + } elsif ($dpart > $lpart) { + $age = 1; + last; + } + } + ok($age == 0, 'form: version >= dbversion'); } |