summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPhillip Davis <phdavis1027@gmail.com>2026-03-21 12:05:08 -0400
committerNguyễn Gia Phong <cnx@loang.net>2026-05-26 00:09:55 +0900
commit781c25ada98d70da41c4b2894ddf9216298cf133 (patch)
treee3124e1bf6bcb9bff37cb0db0d93e4e8d0cbf5d5 /tests
parent514b17c58a732ca0fa995e262b84956717fb937b (diff)
tests: import: gem: Add test for mixed valid and gibberish licenses.
Verifies that when only one of multiple license strings is recognized, the resulting list has the correct license followed by one instance of the symbol 'unknown-license! * tests/import/gem.scm (test-mixed-licenses-json): New fixture. ("gem->guix-package with mixed valid and gibberish licenses"): New test. Change-Id: I33a003d50ba20d30360b52c448ae28ad9d37233b Merges: https://codeberg.org/guix/guix/pulls/8276 Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au> Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/import/gem.scm14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/import/gem.scm b/tests/import/gem.scm
index c1b1afb32d8..56907f445c2 100644
--- a/tests/import/gem.scm
+++ b/tests/import/gem.scm
@@ -151,6 +151,19 @@
151 \"licenses\": [\"foo\", \"bar\"] 151 \"licenses\": [\"foo\", \"bar\"]
152}") 152}")
153 153
154(define test-mixed-licenses-json
155 "{
156 \"name\": \"mixed-license-gem\",
157 \"version\": \"1.0.0\",
158 \"sha\": \"f3676eafca9987cb5fe263df1edf2538bf6dafc712b30e17be3543a9680547a8\",
159 \"info\": \"A gem with one valid and one gibberish license\",
160 \"homepage_uri\": \"https://example.com\",
161 \"dependencies\": {
162 \"runtime\": []
163 },
164 \"licenses\": [\"MIT\", \"nonsense\"]
165}")
166
154(test-begin "gem") 167(test-begin "gem")
155 168
156(test-assert "gem->guix-package" 169(test-assert "gem->guix-package"
@@ -453,4 +466,5 @@ and one gibberish license.")
453 #t) 466 #t)
454 (x 467 (x
455 (pk 'fail x #f))))) 468 (pk 'fail x #f)))))
469
456(test-end "gem") 470(test-end "gem")