aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Tournier <zimon.toutoune@gmail.com>2023-03-11 17:51:10 +0100
committerLudovic Courtès <ludo@gnu.org>2023-03-13 15:08:32 +0100
commit9fb8a480d5aec9186908e92ad18b31455f4aab6b (patch)
treee804749ab2f0c233b363ae4e9e347cbc79456011 /tests
parentd4b2f5eace67b172abd103441fdb7ec2443fb209 (diff)
downloadguix-9fb8a480d5aec9186908e92ad18b31455f4aab6b.tar
guix-9fb8a480d5aec9186908e92ad18b31455f4aab6b.tar.gz
packages: Consider 'patches' by 'package-direct-sources'.
* guix/packages.scm (package-direct-sources): Return 'origin' from 'patches'. * tests/packages.scm: Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/packages.scm17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index f58c47817b..27fb918f90 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -418,12 +419,15 @@
(let* ((o (dummy-origin))
(u (dummy-origin))
(i (dummy-origin))
+ (j (dummy-origin (patches (list o))))
(a (dummy-package "a"))
(b (dummy-package "b" (inputs (list a i))))
(c (package (inherit b) (source o)))
(d (dummy-package "d"
(build-system trivial-build-system)
- (source u) (inputs (list c)))))
+ (source u) (inputs (list c))))
+ (e (dummy-package "e" (source j)))
+ (f (package (inherit e) (inputs (list u)))))
(test-assert "package-direct-sources, no source"
(null? (package-direct-sources a)))
(test-equal "package-direct-sources, #f source"
@@ -437,6 +441,17 @@
(and (= (length (pk 's-sources s)) 2)
(member o s)
(member i s))))
+ (test-assert "package-direct-sources, with patches"
+ (let ((s (package-direct-sources e)))
+ (and (= (length (pk 's-sources s)) 2)
+ (member o s)
+ (member j s))))
+ (test-assert "package-direct-sources, with patches and inputs"
+ (let ((s (package-direct-sources f)))
+ (and (= (length (pk 's-sources s)) 3)
+ (member o s)
+ (member j s)
+ (member u s))))
(test-assert "package-transitive-sources"
(let ((s (package-transitive-sources d)))
(and (= (length (pk 'd-sources s)) 3)