File: version.t

package info (click to toggle)
lintian 2.5.10.4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 12,608 kB
  • sloc: perl: 12,430; sh: 5,787; makefile: 2,834; xml: 1,125; ansic: 347; python: 28; java: 9; tcl: 4; sed: 3
file content (23 lines) | stat: -rwxr-xr-x 921 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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' );