summaryrefslogtreecommitdiff
path: root/tests/ui.scm
diff options
context:
space:
mode:
authorzimoun <zimon.toutoune@gmail.com>2019-09-18 17:57:57 +0200
committerLudovic Courtès <ludo@gnu.org>2019-09-19 23:24:04 +0200
commitd2cdef65605b9e14bfa02c3bf1612ab6b62f4a89 (patch)
tree6868972815e7deca295565a2e84efad7783604ae /tests/ui.scm
parent6ec872231fdf746bd6e11b97f8a6b3a23498806c (diff)
ui: 'relevance' connects regexps with a logical and.
Fixes <https://bugs.gnu.org/36763>. Previously, the logical and connecting the regexps did not output the expected results (introduced in 8874faaaac665100a095ef25e39c9a389f5a397f). * guix/ui.scm (relevance) [score]: Change its arguments. [regexp->score]: New procedure. * tests/ui.scm ("package-relevance"): Add test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/ui.scm')
-rw-r--r--tests/ui.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/ui.scm b/tests/ui.scm
index 2138e23369b..d8573e88d80 100644
--- a/tests/ui.scm
+++ b/tests/ui.scm
@@ -267,6 +267,7 @@ Second line" 24))
267 (gcrypt (specification->package "guile-gcrypt")) 267 (gcrypt (specification->package "guile-gcrypt"))
268 (go (specification->package "go")) 268 (go (specification->package "go"))
269 (gnugo (specification->package "gnugo")) 269 (gnugo (specification->package "gnugo"))
270 (libb2 (specification->package "libb2"))
270 (rx (cut make-regexp <> regexp/icase)) 271 (rx (cut make-regexp <> regexp/icase))
271 (>0 (cut > <> 0)) 272 (>0 (cut > <> 0))
272 (=0 zero?)) 273 (=0 zero?))
@@ -283,6 +284,8 @@ Second line" 24))
283 (=0 (package-relevance go 284 (=0 (package-relevance go
284 (map rx '("go" "game")))) 285 (map rx '("go" "game"))))
285 (>0 (package-relevance gnugo 286 (>0 (package-relevance gnugo
286 (map rx '("go" "game"))))))) 287 (map rx '("go" "game"))))
288 (>0 (package-relevance libb2
289 (map rx '("crypto" "library")))))))
287 290
288(test-end "ui") 291(test-end "ui")