From 8c53742a5e1b5b01a7635ea33dbb72ec3c957e13 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 18 Dec 2022 21:36:53 +0000 Subject: Add back support for foo > 5 in property2name* This is used internally to create search queries. At the same time update synthesis tests to be more representative by using foo[< 5] syntax which has been what is genereated for many many years. --- t/resolve.t | 5 +++++ t/synthesis.t | 25 +++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 't') diff --git a/t/resolve.t b/t/resolve.t index 56869b1..78c73e8 100644 --- a/t/resolve.t +++ b/t/resolve.t @@ -11,6 +11,11 @@ my $testcases = [ name => 'mageia-release', op => '>=', version => '1', + }, { + property => 'mageia-release >= 1', + name => 'mageia-release', + op => '>=', + version => '1', }, { property => 'python3.10dist(fonttools[unicode])[>= 4.10]', name => 'python3.10dist(fonttools[unicode])', diff --git a/t/synthesis.t b/t/synthesis.t index 794fd7a..2f30c46 100644 --- a/t/synthesis.t +++ b/t/synthesis.t @@ -2,7 +2,7 @@ use strict ; use warnings ; -use Test::More tests => 113; +use Test::More tests => 116; use URPM; chdir 't' if -d 't'; @@ -10,10 +10,10 @@ my $file1 = 'synthesis.sample.cz'; my $file2 = 'synthesis.sample-xz.cz'; my $s = <<'EOF'; -@provides@glibc-devel == 6:2.2.4-25mdk -@requires@/sbin/install-info@glibc == 2.2.4@kernel-headers@kernel-headers >= 2.2.1@/bin/sh@/bin/sh@/bin/sh@rpmlib(PayloadFilesHavePrefix) <= 4.0-1@rpmlib(CompressedFileNames) <= 3.0.4-1 -@conflicts@texinfo < 3.11@gcc < 2.96-0.50mdk -@obsoletes@libc-debug@libc-headers@libc-devel@linuxthreads-devel@glibc-debug +@provides@glibc-devel[== 6:2.2.4-25mdk] +@requires@/sbin/install-info@glibc[== 2.2.4]@kernel-headers@kernel-headers[>= 2.2.1]@/bin/sh@/bin/sh@/bin/sh@rpmlib(PayloadFilesHavePrefix)[<= 4.0-1]@rpmlib(CompressedFileNames)[<= 3.0.4-1] +@conflicts@texinfo[< 3.11]@gcc[< 2.96-0.50mdk] +@obsoletes@libc-debug@libc-headers@libc-devel@linuxthreads-devel@glibc-debug[< 3] @info@glibc-devel-2.2.4-25mdk.i586@6@45692097@Development/C EOF @@ -108,21 +108,26 @@ ok($pkg->id == 0); my @obsoletes = $pkg->obsoletes; ok(@obsoletes == 5); ok($obsoletes[0] eq 'libc-debug'); -ok($obsoletes[4] eq 'glibc-debug'); +ok($obsoletes[4] eq 'glibc-debug[< 3]'); + +my @obsoletes_nosense = $pkg->obsoletes_nosense; +ok(@obsoletes_nosense == 5); +ok($obsoletes_nosense[0] eq 'libc-debug'); +ok($obsoletes_nosense[4] eq 'glibc-debug'); my @conflicts = $pkg->conflicts; ok(@conflicts == 2); -ok($conflicts[0] eq 'texinfo < 3.11'); -ok($conflicts[1] eq 'gcc < 2.96-0.50mdk'); +ok($conflicts[0] eq 'texinfo[< 3.11]'); +ok($conflicts[1] eq 'gcc[< 2.96-0.50mdk]'); my @requires = $pkg->requires; ok(@requires == 9); ok($requires[0] eq '/sbin/install-info'); -ok($requires[8] eq 'rpmlib(CompressedFileNames) <= 3.0.4-1'); +ok($requires[8] eq 'rpmlib(CompressedFileNames)[<= 3.0.4-1]'); my @provides = $pkg->provides; ok(@provides == 1); -ok($provides[0] eq 'glibc-devel == 6:2.2.4-25mdk'); +ok($provides[0] eq 'glibc-devel[== 6:2.2.4-25mdk]'); my @files = $pkg->files; ok(@files == 0); -- cgit v1.2.1