guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/10: tests: Exercise 'modify-inputs' with a 'replace' clause.


From: guix-commits
Subject: 02/10: tests: Exercise 'modify-inputs' with a 'replace' clause.
Date: Wed, 16 Mar 2022 10:50:20 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit e3801126a9566bc89c3746a54128609ad6eff1fd
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Mar 15 15:17:04 2022 +0100

    tests: Exercise 'modify-inputs' with a 'replace' clause.
    
    * tests/packages.scm ("modify-inputs, replace")
    ("modify-inputs, replace, change output"): New tests.
---
 tests/packages.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/packages.scm b/tests/packages.scm
index 02bdba5f98..2cb90d3145 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -1956,6 +1956,32 @@
    (dummy-package "a"
      (arguments (this-package-native-input "hello")))))
 
+(test-eq "modify-inputs, replace"
+  coreutils
+  ;; Replace an input; notice that the label in unchanged.
+  (let* ((p1 (dummy-package "p"
+               (inputs (list hello))))
+         (p2 (package
+               (inherit p1)
+               (version "1")
+               (inputs (modify-inputs (package-inputs p1)
+                         (replace "hello" coreutils))))))
+    (lookup-package-input p2 "hello")))
+
+(test-eq "modify-inputs, replace, change output"
+  guile-3.0
+  ;; Replace an input and choose a different output.
+  (let* ((p1 (dummy-package "p"
+               (inputs (list `(,coreutils "debug")))))
+         (p2 (package
+               (inherit p1)
+               (version "1")
+               (inputs (modify-inputs (package-inputs p1)
+                         (replace "coreutils" `(,guile-3.0 "out")))))))
+    (match (package-inputs p2)
+      ((("coreutils" input "out"))
+       input))))
+
 (test-end "packages")
 
 ;;; Local Variables:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]