summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2024-06-03 22:26:28 +0200
committerLudovic Courtès <ludo@gnu.org>2024-06-03 22:58:52 +0200
commite8ab4ccaa7def9838a7fc240609028078a0988b0 (patch)
treef1f24e45967a015276a368108b0e36ee26038ccc /tests
parent2f56845b3332d4aeff7badd64989bea75d20b403 (diff)
style: Fix conversion of ‘unquote-splicing’ by ‘-S arguments’.
* guix/scripts/style.scm (unquote->ungexp): Add missing comma for ‘ungexp-splicing’. * tests/style.scm ("gexpify arguments, substitute-keyword-arguments + unquote-splicing"): New test. Change-Id: I17dcdd9b4812d54ddba1137e369360706b137bb4
Diffstat (limited to 'tests')
-rw-r--r--tests/style.scm25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/style.scm b/tests/style.scm
index 5e38549606d..3125f4cb1b6 100644
--- a/tests/style.scm
+++ b/tests/style.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2021-2023 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2021-2024 Ludovic Courtès <ludo@gnu.org>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -500,6 +500,29 @@
500 (load file) 500 (load file)
501 (read-package-field (@ (my-packages) my-coreutils) 'arguments 7)))) 501 (read-package-field (@ (my-packages) my-coreutils) 'arguments 7))))
502 502
503(test-equal "gexpify arguments, substitute-keyword-arguments + unquote-splicing"
504 "\
505 (substitute-keyword-arguments (package-arguments coreutils)
506 ((#:make-flags flags
507 #~'())
508 #~(cons \"-DXYZ=yes\"
509 #$@(if #t flags
510 '())))))\n"
511 (call-with-test-package '((arguments
512 (substitute-keyword-arguments
513 (package-arguments coreutils)
514 ((#:make-flags flags ''())
515 `(cons "-DXYZ=yes" ,@(if #t flags '()))))))
516 (lambda (directory)
517 (define file
518 (string-append directory "/my-packages.scm"))
519
520 (system* "guix" "style" "-L" directory "my-coreutils"
521 "-S" "arguments")
522
523 (load file)
524 (read-package-field (@ (my-packages) my-coreutils) 'arguments 6))))
525
503(test-equal "gexpify arguments, append substitute-keyword-arguments" 526(test-equal "gexpify arguments, append substitute-keyword-arguments"
504 "\ 527 "\
505 (append (list #:tests? #f) 528 (append (list #:tests? #f)