summaryrefslogtreecommitdiff
path: root/tests
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
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')
-rw-r--r--tests/ui.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/ui.scm b/tests/ui.scm
index 2138e23369..d8573e88d8 100644
--- a/tests/ui.scm
+++ b/tests/ui.scm
@@ -267,6 +267,7 @@ Second line" 24))
(gcrypt (specification->package "guile-gcrypt"))
(go (specification->package "go"))
(gnugo (specification->package "gnugo"))
+ (libb2 (specification->package "libb2"))
(rx (cut make-regexp <> regexp/icase))
(>0 (cut > <> 0))
(=0 zero?))
@@ -283,6 +284,8 @@ Second line" 24))
(=0 (package-relevance go
(map rx '("go" "game"))))
(>0 (package-relevance gnugo
- (map rx '("go" "game")))))))
+ (map rx '("go" "game"))))
+ (>0 (package-relevance libb2
+ (map rx '("crypto" "library")))))))
(test-end "ui")