summaryrefslogtreecommitdiff
path: root/tests/packages.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-08-26 18:35:14 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-08-26 18:35:14 +0200
commit17dddeeee560527a8f30d37761949d658056cb09 (patch)
tree15b0b19c55787f556eb9b42c28d173bddc5435db /tests/packages.scm
parent331a09654eb7e9f6212b7e8469077fa7393e8b11 (diff)
parent6a9581741e4ee81226aeb2f1c997df76670a6aab (diff)
downloadguix-patches-17dddeeee560527a8f30d37761949d658056cb09.tar
guix-patches-17dddeeee560527a8f30d37761949d658056cb09.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'tests/packages.scm')
-rw-r--r--tests/packages.scm23
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index 6aa36170d2..cbd0503733 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -23,7 +23,8 @@
#:use-module (guix monads)
#:use-module (guix grafts)
#:use-module ((guix gexp) #:select (local-file local-file-file))
- #:use-module ((guix utils)
+ #:use-module (guix utils)
+ #:use-module ((guix diagnostics)
;; Rename the 'location' binding to allow proper syntax
;; matching when setting the 'location' field of a package.
#:renamer (lambda (name)
@@ -617,12 +618,11 @@
(string=? (derivation->output-path drv)
(package-output %store package "out")))))
-(test-assert "patch not found yields a run-time error"
- (guard (c ((condition-has-type? c &message)
- (and (string-contains (condition-message c)
- "does-not-exist.patch")
- (string-contains (condition-message c)
- "not found"))))
+(test-equal "patch not found yields a run-time error"
+ '("~a: patch not found\n" "does-not-exist.patch")
+ (guard (c ((formatted-message? c)
+ (cons (formatted-message-string c)
+ (formatted-message-arguments c))))
(let ((p (package
(inherit (dummy-package "p"))
(source (origin
@@ -1326,6 +1326,15 @@
result))
'()))))))
+ (define (find-duplicates l)
+ (match l
+ (() '())
+ ((head . tail)
+ (if (member head tail)
+ (cons head (find-duplicates tail))
+ (find-duplicates tail)))))
+
+ (pk (find-duplicates from-cache))
(and (equal? (delete-duplicates from-cache) from-cache)
(lset= equal? no-cache from-cache))))