diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2020-09-05 21:56:34 +0300 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2020-09-05 22:30:04 +0300 |
commit | de3c03a47160dec355d9b19ad5ca210d90c15fd7 (patch) | |
tree | 4ca6dc05b5fc9530d812bbb269f1c61ab9efccf3 /tests/packages.scm | |
parent | ab6fe9d362046231ad6f46eccfd1ea2c9c80b401 (diff) | |
parent | b8477cab7bccc4191ed3dfa3f149aec7917834d8 (diff) | |
download | guix-patches-de3c03a47160dec355d9b19ad5ca210d90c15fd7.tar guix-patches-de3c03a47160dec355d9b19ad5ca210d90c15fd7.tar.gz |
Merge remote-tracking branch 'origin/master' into staging
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)))) |