diff options
author | Efraim Flashner <efraim@flashner.co.il> | 2023-01-30 11:33:18 +0200 |
---|---|---|
committer | Efraim Flashner <efraim@flashner.co.il> | 2023-01-30 12:39:40 +0200 |
commit | 4cf1acc7f3033b50b0bf19e02c9f522d522d338c (patch) | |
tree | 9fd64956ee60304c15387eb394cd649e49f01467 /tests/import-utils.scm | |
parent | edb8c09addd186d9538d43b12af74d6c7aeea082 (diff) | |
parent | 595b53b74e3ef57a1c0c96108ba86d38a170a241 (diff) |
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts:
doc/guix.texi
gnu/local.mk
gnu/packages/admin.scm
gnu/packages/base.scm
gnu/packages/chromium.scm
gnu/packages/compression.scm
gnu/packages/databases.scm
gnu/packages/diffoscope.scm
gnu/packages/freedesktop.scm
gnu/packages/gnome.scm
gnu/packages/gnupg.scm
gnu/packages/guile.scm
gnu/packages/inkscape.scm
gnu/packages/llvm.scm
gnu/packages/openldap.scm
gnu/packages/pciutils.scm
gnu/packages/ruby.scm
gnu/packages/samba.scm
gnu/packages/sqlite.scm
gnu/packages/statistics.scm
gnu/packages/syndication.scm
gnu/packages/tex.scm
gnu/packages/tls.scm
gnu/packages/version-control.scm
gnu/packages/xml.scm
guix/build-system/copy.scm
guix/scripts/home.scm
Diffstat (limited to 'tests/import-utils.scm')
-rw-r--r-- | tests/import-utils.scm | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/tests/import-utils.scm b/tests/import-utils.scm index 7c6c782917..44dff14597 100644 --- a/tests/import-utils.scm +++ b/tests/import-utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2015, 2017, 2022 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com> ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net> ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev> @@ -32,14 +32,27 @@ (test-begin "import-utils") (test-equal "beautify-description: use double spacing" - "This is a package. It is great. Trust me Mr. Hendrix." + "\ +Trust me Mr. Hendrix, M. Night Shyamalan et al. \ +Differences are hard to spot, +e.g. in CLOS vs. GOOPS." (beautify-description - "This is a package. It is great. Trust me Mr. Hendrix.")) + " +Trust me Mr. Hendrix, M. Night Shyamalan et al. \ +Differences are hard to spot, e.g. in CLOS vs. GOOPS.")) (test-equal "beautify-description: transform fragment into sentence" "This package provides a function to establish world peace" (beautify-description "A function to establish world peace")) +(test-equal "beautify-description: remove single quotes" + "CRAN likes to quote acronyms and function names." + (beautify-description "CRAN likes to 'quote' acronyms and 'function' names.")) + +(test-equal "beautify-description: escape @" + "This @@ is not Texinfo syntax. Neither is this %@@>%." + (beautify-description "This @ is not Texinfo syntax. Neither is this %@>%.")) + (test-equal "license->symbol" 'license:lgpl2.0 (license->symbol license:lgpl2.0)) @@ -54,12 +67,12 @@ #:repo 'repo #:repo->guix-package (match-lambda* - (("foo" #:version #f #:repo 'repo) + (("foo" #:repo 'repo . rest) (values '(package (name "foo") (inputs `(("bar" ,bar)))) '("bar"))) - (("bar" #:version #f #:repo 'repo) + (("bar" #:repo 'repo . rest) (values '(package (name "bar")) '()))) @@ -71,7 +84,7 @@ #:repo 'repo #:repo->guix-package (match-lambda* - (("foo" #:version #f #:repo 'repo) + (("foo" #:repo 'repo . rest) (values #f '()))) #:guix-name identity)) @@ -83,12 +96,12 @@ #:repo 'repo #:repo->guix-package (match-lambda* - (("foo" #:version #f #:repo 'repo) + (("foo" #:repo 'repo . rest) (values '(package (name "foo") (inputs `(("bar" ,bar)))) '("bar"))) - (("bar" #:version #f #:repo 'repo) + (("bar" #:repo 'repo . rest) (values #f '()))) #:guix-name identity)) @@ -203,4 +216,28 @@ ("license" . #f)))) (package-native-inputs (alist->package meta)))) +(test-assert "alist->package with properties" + (let* ((meta '(("name" . "hello") + ("version" . "2.10") + ("source" . + ;; Use a 'file://' URI so that we don't cause a download. + ,(string-append "file://" + (search-path %load-path "guix.scm"))) + ("build-system" . "gnu") + ("properties" . (("hidden?" . #t) + ("upstream-name" . "hello-upstream"))) + ("home-page" . "https://gnu.org") + ("synopsis" . "Say hi") + ("description" . "This package says hi.") + ("license" . "GPL-3.0+"))) + (pkg (alist->package meta))) + (and (package? pkg) + (equal? (package-upstream-name pkg) "hello-upstream") + (hidden-package? pkg)))) + +(test-equal "spdx-string->license" + '(license:gpl3+ license:agpl3 license:gpl2+) + (map spdx-string->license + '("GPL-3.0-oR-LaTeR" "AGPL-3.0" "GPL-2.0+"))) + (test-end "import-utils") |