[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1233] branches/1.2/t/99-versioning.t
- Subject: SF.net SVN: ledger-smb: [1233] branches/1.2/t/99-versioning.t
- From: ..hidden..
- Date: Mon, 21 May 2007 10:24:53 -0700
Revision: 1233
http://svn.sourceforge.net/ledger-smb/?rev=1233&view=rev
Author: tetragon
Date: 2007-05-21 10:24:18 -0700 (Mon, 21 May 2007)
Log Message:
-----------
Adding versioning sanity checks
Added Paths:
-----------
branches/1.2/t/99-versioning.t
Added: branches/1.2/t/99-versioning.t
===================================================================
--- branches/1.2/t/99-versioning.t (rev 0)
+++ branches/1.2/t/99-versioning.t 2007-05-21 17:24:18 UTC (rev 1233)
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 9;
+
+use LedgerSMB::Form;
+
+my $form = new Form;
+ok(defined $form, 'form: defined');
+isa_ok($form, 'Form', 'form: correct type');
+ok(defined $form->{version}, 'form: version set');
+ok(defined $form->{dbversion}, 'form: dbversion set');
+$form->{version} =~ s/\s//g;
+$form->{dbversion} =~ s/\s//g;
+
+ok(-e 'VERSION', 'VERSION exists');
+ok(-s 'VERSION', 'VERSION non-empty');
+ok(-r 'VERSION', 'VERSION readable');
+open(my $FH, '<', 'VERSION');
+my $ver = readline $FH;
+close $FH;
+chomp $ver;
+$ver =~ s/\s//g;
+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');
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.