summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-11 17:56:06 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-11 17:56:06 +0000
commit4821e8f07f6c3da900cfde354b47adcdd6bf8689 (patch)
tree42db03ae1b114a4932214aa9de69a6c3b710bcf0 /t
parentb918bc1fa99038769a2cbfb55ca1a2bf227709aa (diff)
Removing 1.1 net-setup.pl and improving versioning checks
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1266 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 't')
-rw-r--r--t/99-versioning.t18
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');
}