diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2004-08-29 11:56:23 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2004-08-29 11:56:23 +0000 |
commit | 8105bf5cf365aab3e2e5dc0bb7a2aadfe0758120 (patch) | |
tree | 713ccd45e4c56dfcbb16cffaff0ff2c751395dd6 /t/parse.t | |
parent | 1ec97fe0b0f5a00885a498dafc2c694e8a571185 (diff) | |
download | perl-URPM-8105bf5cf365aab3e2e5dc0bb7a2aadfe0758120.tar perl-URPM-8105bf5cf365aab3e2e5dc0bb7a2aadfe0758120.tar.gz perl-URPM-8105bf5cf365aab3e2e5dc0bb7a2aadfe0758120.tar.bz2 perl-URPM-8105bf5cf365aab3e2e5dc0bb7a2aadfe0758120.tar.xz perl-URPM-8105bf5cf365aab3e2e5dc0bb7a2aadfe0758120.zip |
- backport rpmvercmp binding from perl-Hdlist
Diffstat (limited to 't/parse.t')
-rw-r--r-- | t/parse.t | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -44,6 +44,14 @@ ok($pkg->get_tag(1001) eq '1.0'); ok($pkg->get_tag(1002) eq '1mdk'); ok($pkg->queryformat("%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}") eq "test-rpm-1.0-1mdk.noarch"); +# Version comparison +ok(URPM::rpmvercmp("1-1mdk", "1-1mdk") == 0, "Same value = 0"); +ok(URPM::rpmvercmp("0:1-1mdk", "1-1mdk") == -1, "Same value, epoch 0 on left = 1"); +ok(URPM::rpmvercmp("1-1mdk", "1-2mdk") == -1, "Right value win = -1"); +ok(URPM::rpmvercmp("1-2mdk", "1-1mdk") == 1, "Left value win = 1"); +ok(URPM::rpmvercmp("1:1-1mdk", "2:1-1mdk") == -1, "epoch 1 vs 2 = -1"); + + { open(my $hdfh, "zcat hdlist.cz |") or die $!; my $pkg = URPM::stream2header($hdfh); |