diff options
-rw-r--r-- | URPM.xs | 5 | ||||
-rw-r--r-- | t/parse.t | 8 |
2 files changed, 13 insertions, 0 deletions
@@ -3234,6 +3234,11 @@ Urpm_list_rpm_tag(urpm=Nullsv) } int +rpmvercmp(one, two) + char *one + char *two + +int Urpm_ranges_overlap(a, b, b_nopromote=1) char *a char *b @@ -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); |