diff options
Diffstat (limited to 'tests/packages.scm')
-rw-r--r-- | tests/packages.scm | 23 |
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)))) |