summaryrefslogtreecommitdiff
path: root/tests/import-utils.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-10-12 14:33:56 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-10-12 14:36:44 +0300
commit322917aeb8e672c21378fd371a5cff4a9f0c2520 (patch)
tree70229faa39f14caa09b769153453c3898f64f7fc /tests/import-utils.scm
parent407f017663c97ebfe48e3cb304bf97bf2557f83f (diff)
parente1baf802ccd8af4f7b416b0987db706f2dbfc42f (diff)
Merge remote-tracking branch 'origin/master' into staging
Conflicts: gnu/packages/gnuzilla.scm gnu/packages/graphics.scm gnu/packages/gstreamer.scm gnu/packages/gtk.scm gnu/packages/kde-frameworks.scm gnu/packages/video.scm
Diffstat (limited to 'tests/import-utils.scm')
-rw-r--r--tests/import-utils.scm38
1 files changed, 35 insertions, 3 deletions
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 7c6c782917..026c48bb1e 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))
@@ -203,4 +216,23 @@
("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-end "import-utils")