summary refs log tree commit diff
path: root/tests/import-utils.scm
diff options
context:
space:
mode:
authorPhilip McGrath <philip@philipmcgrath.com>2022-10-19 01:04:48 -0400
committerLudovic Courtès <ludo@gnu.org>2022-11-18 15:44:38 +0100
commit07482dc0511350d596fdd25f7645dd6f4f91313b (patch)
treeabb17dda079dd554a6ab15eaf73a0fba2e843ac5 /tests/import-utils.scm
parentb253efef2315ec0bbd5dce1272591d51a2daef0e (diff)
downloadguix-07482dc0511350d596fdd25f7645dd6f4f91313b.tar.gz
import/utils: spdx-string->license: Match case-insensitively.
SPDX specifies that license identifiers (unlike the 'AND', 'OR', and
'WITH' operators) are matched case-insensitively.

* guix/import/utils.scm (%spdx-license-identifiers): New variable.
(spdx-string->license): Search in '%spdx-license-identifiers' using
'string-ci=?'.
* tests/import-utils.scm ("spdx-string->license"): New test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/import-utils.scm')
-rw-r--r--tests/import-utils.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/import-utils.scm b/tests/import-utils.scm
index 026c48bb1e..ee5b16adb8 100644
--- a/tests/import-utils.scm
+++ b/tests/import-utils.scm
@@ -235,4 +235,9 @@ Differences are hard to spot, e.g. in CLOS vs. GOOPS."))
          (equal? (package-upstream-name pkg) "hello-upstream")
          (hidden-package? pkg))))
 
+(test-equal "spdx-string->license"
+  '(license:gpl3+ license:agpl3)
+  (map spdx-string->license
+       '("GPL-3.0-oR-LaTeR" "AGPL-3.0")))
+
 (test-end "import-utils")