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: I17dcdd9b4812d54ddba1137e369360706b137bb4master
parent
2f56845b33
commit
e8ab4ccaa7
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2021-2023 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2021-2024 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -304,7 +304,7 @@ counterpart."
|
||||||
value))
|
value))
|
||||||
(('unquote-splicing x)
|
(('unquote-splicing x)
|
||||||
(if (= quotation 1)
|
(if (= quotation 1)
|
||||||
`(ungexp-splicing x)
|
`(ungexp-splicing ,x)
|
||||||
value))
|
value))
|
||||||
(('quasiquote x)
|
(('quasiquote x)
|
||||||
(list 'quasiquote (loop x (+ quotation 1))))
|
(list 'quasiquote (loop x (+ quotation 1))))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2021-2023 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2021-2024 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -500,6 +500,29 @@
|
||||||
(load file)
|
(load file)
|
||||||
(read-package-field (@ (my-packages) my-coreutils) 'arguments 7))))
|
(read-package-field (@ (my-packages) my-coreutils) 'arguments 7))))
|
||||||
|
|
||||||
|
(test-equal "gexpify arguments, substitute-keyword-arguments + unquote-splicing"
|
||||||
|
"\
|
||||||
|
(substitute-keyword-arguments (package-arguments coreutils)
|
||||||
|
((#:make-flags flags
|
||||||
|
#~'())
|
||||||
|
#~(cons \"-DXYZ=yes\"
|
||||||
|
#$@(if #t flags
|
||||||
|
'())))))\n"
|
||||||
|
(call-with-test-package '((arguments
|
||||||
|
(substitute-keyword-arguments
|
||||||
|
(package-arguments coreutils)
|
||||||
|
((#:make-flags flags ''())
|
||||||
|
`(cons "-DXYZ=yes" ,@(if #t flags '()))))))
|
||||||
|
(lambda (directory)
|
||||||
|
(define file
|
||||||
|
(string-append directory "/my-packages.scm"))
|
||||||
|
|
||||||
|
(system* "guix" "style" "-L" directory "my-coreutils"
|
||||||
|
"-S" "arguments")
|
||||||
|
|
||||||
|
(load file)
|
||||||
|
(read-package-field (@ (my-packages) my-coreutils) 'arguments 6))))
|
||||||
|
|
||||||
(test-equal "gexpify arguments, append substitute-keyword-arguments"
|
(test-equal "gexpify arguments, append substitute-keyword-arguments"
|
||||||
"\
|
"\
|
||||||
(append (list #:tests? #f)
|
(append (list #:tests? #f)
|
||||||
|
|
Reference in New Issue