[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.2.10-65-gb930777



The following commit has been merged in the master branch:
commit b93077751e88d70ae1e722936720a699b47e5205
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Fri May 29 19:05:51 2009 +0100

    Add a test script for Lintian::Relation::Version
    
    * t/scripts/version.t:
      + [ADB] New script to test Lintian::Relation::Version.

diff --git a/debian/changelog b/debian/changelog
index 888ad90..df399a6 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -135,6 +135,8 @@ lintian (2.2.11) UNRELEASED; urgency=low
   * t/scripts/{static-lab,tags}.t:
     + [ADB] New test scripts splitting some of the "harness checking" out
       of the runtests script.  Patch by Raphael Geissert.
+  * t/scripts/version.t:
+    + [ADB] New script to test Lintian::Relation::Version.
   * t/tests/lintian-overrides:
     + [ADB] New testset for the {malformed,unused}-override tags.  Patch by
       Raphael Geissert.
diff --git a/t/scripts/version.t b/t/scripts/version.t
new file mode 100644
index 0000000..42959bd
--- /dev/null
+++ b/t/scripts/version.t
@@ -0,0 +1,23 @@
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 13;
+
+use Lintian::Relation::Version;
+
+ok(  versions_equal('1.0', '1.0'), 'Basic equality' );
+ok(  versions_equal('1.0', '1.00'), '0 == 00' );
+ok(  versions_gte('1.1', '1.0'), 'Basic >=' );
+ok( !versions_lte('1.1', '1.0'), 'Basic <=' );
+ok(  versions_gt('1.1', '1.0'), 'Basic >' );
+ok( !versions_lt('1.1', '1.1'), 'Basic <' );
+
+ok(  versions_compare('1.1', '<=', '1.1'), 'compare() <=' );
+ok(  versions_compare('1.2', '>=', '1.1'), 'compare() >=' );
+ok(  versions_compare('0:1-1', '=', '1-1'), 'compare() = with epoch 0' );
+ok(  versions_compare('2.3~', '<<', '2.3'), 'compare() << with tilde' );
+ok( !versions_compare('1:1.0', '>>', '1:1.1'), 'compare() >> with equal epoch' );
+ok( !versions_compare('1:1.1', '>>', '2:1.0'), 'compare() >> with different epochs' );
+ok(  versions_compare('1:1.1', '<<', '2:1.1'), 'compare() << with different epochs' );

-- 
Debian package checker


Reply to: