diff options
Diffstat (limited to 'tests/transformations.scm')
-rw-r--r-- | tests/transformations.scm | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/tests/transformations.scm b/tests/transformations.scm index 5285d98f17..9f5aacc41b 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm @@ -217,6 +217,28 @@ (test-equal "options->transformation, with-branch" (git-checkout (url "https://example.org") + (branch "devel")) + (let* ((p (dummy-package "guix.scm" + (inputs `(("foo" ,grep) + ("bar" ,(dummy-package "chbouib" + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://example.org") + (commit "cabba9e"))) + (sha256 #f))))))))) + (t (options->transformation '((with-branch . "chbouib=devel"))))) + (let ((new (t p))) + (and (not (eq? new p)) + (match (package-inputs new) + ((("foo" dep1) ("bar" dep2)) + (and (string=? (package-full-name dep1) + (package-full-name grep)) + (string=? (package-name dep2) "chbouib") + (package-source dep2)))))))) + +(test-equal "options->transformation, with-branch, recursive? inheritance" + (git-checkout (url "https://example.org") (branch "devel") (recursive? #t)) (let* ((p (dummy-package "guix.scm" @@ -226,7 +248,8 @@ (method git-fetch) (uri (git-reference (url "https://example.org") - (commit "cabba9e"))) + (commit "cabba9e") + (recursive? #t))) (sha256 #f))))))))) (t (options->transformation '((with-branch . "chbouib=devel"))))) (let ((new (t p))) @@ -240,6 +263,28 @@ (test-equal "options->transformation, with-commit" (git-checkout (url "https://example.org") + (commit "abcdef")) + (let* ((p (dummy-package "guix.scm" + (inputs `(("foo" ,grep) + ("bar" ,(dummy-package "chbouib" + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://example.org") + (commit "cabba9e"))) + (sha256 #f))))))))) + (t (options->transformation '((with-commit . "chbouib=abcdef"))))) + (let ((new (t p))) + (and (not (eq? new p)) + (match (package-inputs new) + ((("foo" dep1) ("bar" dep2)) + (and (string=? (package-full-name dep1) + (package-full-name grep)) + (string=? (package-name dep2) "chbouib") + (package-source dep2)))))))) + +(test-equal "options->transformation, with-commit, recursive? inheritance" + (git-checkout (url "https://example.org") (commit "abcdef") (recursive? #t)) (let* ((p (dummy-package "guix.scm" @@ -249,7 +294,8 @@ (method git-fetch) (uri (git-reference (url "https://example.org") - (commit "cabba9e"))) + (commit "cabba9e") + (recursive? #t))) (sha256 #f))))))))) (t (options->transformation '((with-commit . "chbouib=abcdef"))))) (let ((new (t p))) |