aboutsummaryrefslogtreecommitdiff
path: root/tests/import-utils.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-02-16 11:06:31 +0100
committerLudovic Courtès <ludo@gnu.org>2018-02-16 11:10:12 +0100
commit5e2495d09e5ad78f8ebb6bfa6fb4ff09fb305ec4 (patch)
treea25e08f2cf2d0910ec0371f46132edad10b265ec /tests/import-utils.scm
parent469069b6e8e05a46e5fd52f1afa1102d2bb1d927 (diff)
downloadpatches-5e2495d09e5ad78f8ebb6bfa6fb4ff09fb305ec4.tar
patches-5e2495d09e5ad78f8ebb6bfa6fb4ff09fb305ec4.tar.gz
import: utils: 'alist->package' allows false license.
Reported by <pkill9@runbox.com>. Fixes <https://bugs.gnu.org/30470>. * guix/import/utils.scm (alist->package): Check whether 'license' is false and set the 'license' field to #f in this case. * tests/import-utils.scm ("alist->package with false license"): New test.
Diffstat (limited to 'tests/import-utils.scm')
-rw-r--r--tests/import-utils.scm19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index f4bbd335b9..5c0c041360 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -79,4 +79,23 @@
(equal? (origin-sha256 (package-source pkg))
(base32 "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i")))))
+(test-equal "alist->package with false license" ;<https://bugs.gnu.org/30470>
+ 'license-is-false
+ (let* ((meta '(("name" . "hello")
+ ("version" . "2.10")
+ ("source" . (("method" . "url-fetch")
+ ("uri" . "mirror://gnu/hello/hello-2.10.tar.gz")
+ ("sha256" .
+ (("base32" .
+ "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i")))))
+ ("build-system" . "gnu")
+ ("home-page" . "https://gnu.org")
+ ("synopsis" . "Say hi")
+ ("description" . "This package says hi.")
+ ("license" . #f))))
+ ;; Note: Use 'or' because comparing with #f otherwise succeeds when
+ ;; there's an exception instead of an actual #f.
+ (or (package-license (alist->package meta))
+ 'license-is-false)))
+
(test-end "import-utils")