aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/scripts-build.scm36
1 files changed, 33 insertions, 3 deletions
diff --git a/tests/scripts-build.scm b/tests/scripts-build.scm
index 54681274b9..4bf1e1a719 100644
--- a/tests/scripts-build.scm
+++ b/tests/scripts-build.scm
@@ -139,12 +139,15 @@
(and (not (eq? new p))
(match (package-inputs new)
((("foo" dep1) ("bar" dep2) ("baz" dep3))
- (and (eq? dep1 busybox)
- (eq? dep2 findutils)
+ (and (string=? (package-full-name dep1)
+ (package-full-name busybox))
+ (string=? (package-full-name dep2)
+ (package-full-name findutils))
(string=? (package-name dep3) "chbouib")
(match (package-native-inputs dep3)
((("x" dep))
- (eq? dep findutils)))))))))))
+ (string=? (package-full-name dep)
+ (package-full-name findutils))))))))))))
(test-assert "options->transformation, with-graft"
(let* ((p (dummy-package "guix.scm"
@@ -186,4 +189,31 @@
((("x" dep3))
(map package-source (list dep1 dep3))))))))))))
+(test-equal "options->transformation, with-git-url + with-branch"
+ ;; Combine the two options and make sure the 'with-branch' transformation
+ ;; comes after the 'with-git-url' transformation.
+ (let ((source (git-checkout (url "https://example.org")
+ (branch "BRANCH")
+ (recursive? #t))))
+ (list source source))
+ (let* ((p (dummy-package "guix.scm"
+ (inputs `(("foo" ,grep)
+ ("bar" ,(dummy-package "chbouib"
+ (native-inputs `(("x" ,grep)))))))))
+ (t (options->transformation
+ (reverse '((with-git-url
+ . "grep=https://example.org")
+ (with-branch . "grep=BRANCH"))))))
+ (with-store store
+ (let ((new (t store p)))
+ (and (not (eq? new p))
+ (match (package-inputs new)
+ ((("foo" dep1) ("bar" dep2))
+ (and (string=? (package-name dep1) "grep")
+ (string=? (package-name dep2) "chbouib")
+ (match (package-native-inputs dep2)
+ ((("x" dep3))
+ (map package-source (list dep1 dep3))))))))))))
+
+
(test-end)