aboutsummaryrefslogtreecommitdiffstats
path: root/t/parse.t
diff options
context:
space:
mode:
Diffstat (limited to 't/parse.t')
-rw-r--r--t/parse.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/parse.t b/t/parse.t
index 34d767e..5442a95 100644
--- a/t/parse.t
+++ b/t/parse.t
@@ -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);