summaryrefslogtreecommitdiff
path: root/tests/import
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim@guixotic.coop>2026-08-08 17:22:18 +0900
committerMaxim Cournoyer <maxim@guixotic.coop>2026-08-25 10:07:51 +0900
commitd131c228dc32bb71e75717f9dc260b6e6812f73d (patch)
tree9d08e71c08af111caee178ad8176858c7bc6423c /tests/import
parentd485ff319a82fb4d497e1d5435d881608f4bdf10 (diff)
import/utils: Allow `find-version' to match an over-specified version.
This fixes the use case of using --target-version with an exact match (--target-version causes the partial? mode to be enabled). * tests/import/utils.scm ("find-version, latest") ("find-version, empty versions list") ("find-version, partial, under-specified") ("find-version, partial, exact") ("find-version, partial, over-specified"): New tests. * guix/import/utils.scm (find-version): [PARTIAL?]: Truncate VERSION to the maximum length of VERSIONS. Explicitly handle the empty versions case.
Diffstat (limited to 'tests/import')
-rw-r--r--tests/import/utils.scm25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/import/utils.scm b/tests/import/utils.scm
index c82fef78ec7..44559e2c237 100644
--- a/tests/import/utils.scm
+++ b/tests/import/utils.scm
@@ -281,6 +281,31 @@ Differences are hard to spot, e.g. in CLOS vs. GOOPS."))
281 (map spdx-string->license 281 (map spdx-string->license
282 '("GPL-3.0-oR-LaTeR" "AGPL-3.0" "GPL-2.0+"))) 282 '("GPL-3.0-oR-LaTeR" "AGPL-3.0" "GPL-2.0+")))
283 283
284
285;;;
286;;; find-version.
287;;;
288
289(test-equal "find-version, empty versions list"
290 #f
291 (find-version '()))
292
293(test-equal "find-version, latest"
294 "6.11.1"
295 (find-version '("6.9" "6.8" "6.5" "6.11.1" "6.10.3")))
296
297(test-equal "find-version, partial, exact"
298 "6.10.3"
299 (find-version '("6.9" "6.8" "6.5" "6.11.1" "6.10.3") "6.10.3" #t))
300
301(test-equal "find-version, partial, under-specified"
302 "6.10.3"
303 (find-version '("6.9" "6.8" "6.5" "6.11.1" "6.10.3") "6.10" #t))
304
305(test-equal "find-version, partial, over-specified"
306 "6.10"
307 (find-version '("6.9" "6.8" "6.5" "6.11" "6.10") "6.10.3" #t))
308
284;;; 309;;;
285;;; default-git-error 310;;; default-git-error
286;;; 311;;;