summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-06-11 23:30:32 +0200
committerMarius Bakke <marius@gnu.org>2020-06-11 23:30:32 +0200
commit9b043df7403a10b35b93d133aac796fd277a7339 (patch)
treef712922d9348ececc0d84e360ac653df3b8d2473 /tests
parentd79ec4fd343bc2a72652aa3a4b4ae14bd8df88ac (diff)
parent648ae62112f62bc2106fb36d45c83fda787d3bed (diff)
downloadguix-9b043df7403a10b35b93d133aac796fd277a7339.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'tests')
-rw-r--r--tests/git.scm3
-rw-r--r--tests/packages.scm24
2 files changed, 25 insertions, 2 deletions
diff --git a/tests/git.scm b/tests/git.scm
index 4a806abcc3..aa4f03ca62 100644
--- a/tests/git.scm
+++ b/tests/git.scm
@@ -119,8 +119,7 @@
                     (list commit3 commit4))
              (lset= eq? (commit-difference commit4 commit1 (list commit3))
                     (list commit4))
-             (lset= eq? (commit-difference commit4 commit1 (list commit5))
-                    (list commit2 commit3 commit4)))))))
+             (null? (commit-difference commit4 commit1 (list commit5))))))))
 
 (unless (which (git-command)) (test-skip 1))
 (test-equal "commit-relation"
diff --git a/tests/packages.scm b/tests/packages.scm
index 72e87dbfb7..c7b6f669b5 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -900,6 +900,30 @@
                                                          (replacement #f))))
                     (replacement (package-derivation %store new)))))))
 
+(test-assert "package-grafts, dependency on several outputs"
+  ;; Make sure we get one graft per output; see <https://bugs.gnu.org/41796>.
+  (letrec* ((p0  (dummy-package "p0"
+                   (version "1.0")
+                   (replacement p0*)
+                   (arguments '(#:implicit-inputs? #f))
+                   (outputs '("out" "lib"))))
+            (p0* (package (inherit p0) (version "1.1")))
+            (p1  (dummy-package "p1"
+                   (arguments '(#:implicit-inputs? #f))
+                   (inputs `(("p0" ,p0)
+                             ("p0:lib" ,p0 "lib"))))))
+    (lset= equal? (pk (package-grafts %store p1))
+           (list (graft
+                   (origin (package-derivation %store p0))
+                   (origin-output "out")
+                   (replacement (package-derivation %store p0*))
+                   (replacement-output "out"))
+                 (graft
+                   (origin (package-derivation %store p0))
+                   (origin-output "lib")
+                   (replacement (package-derivation %store p0*))
+                   (replacement-output "lib"))))))
+
 (test-assert "replacement also grafted"
   ;; We build a DAG as below, where dotted arrows represent replacements and
   ;; solid arrows represent dependencies: