summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-04-04 22:05:15 +0200
committerLudovic Courtès <ludo@gnu.org>2021-03-30 22:48:43 +0200
commitba41f87ec77a3ee1757fd79ea53c171593451c6f (patch)
treea3cb90825d3c7eb6dc0a9f260bfa8b9db3536906 /tests
parent7d873f194ca69d6096d28d7a224ab78e83e34fe1 (diff)
downloadguix-ba41f87ec77a3ee1757fd79ea53c171593451c6f.tar.gz
packages: Turn 'bag->derivation' into a monadic procedure.
* guix/packages.scm (bag->derivation): Turn into a monadic procedure by
  remove 'store' parameter and removing the call to 'store-lower'.
  (bag->cross-derivation): Likewise.
  (bag->derivation*): New procedure.
  (package-derivation, package-cross-derivation): Use it instead of
  'bag->derivation'.
* tests/packages.scm ("bag->derivation"): Change to monadic style.
  ("bag->derivation, cross-compilation"): Likewise.
Diffstat (limited to 'tests')
-rw-r--r--tests/packages.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index d1dab7d6a5..f68b078b55 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -1243,12 +1243,13 @@
             (parameterize ((%current-target-system #f))
               (bag-transitive-inputs bag)))))
 
-(test-assert "bag->derivation"
+(test-assertm "bag->derivation"
   (parameterize ((%graft? #f))
     (let ((bag (package->bag gnu-make))
           (drv (package-derivation %store gnu-make)))
       (parameterize ((%current-system "foox86-hurd")) ;should have no effect
-        (equal? drv (bag->derivation %store bag))))))
+        (mlet %store-monad ((bag-drv (bag->derivation bag)))
+          (return (equal? drv bag-drv)))))))
 
 (test-assert "bag->derivation, cross-compilation"
   (parameterize ((%graft? #f))
@@ -1257,7 +1258,8 @@
            (drv    (package-cross-derivation %store gnu-make target)))
       (parameterize ((%current-system "foox86-hurd") ;should have no effect
                      (%current-target-system "foo64-linux-gnu"))
-        (equal? drv (bag->derivation %store bag))))))
+        (mlet %store-monad ((bag-drv (bag->derivation bag)))
+          (return (equal? drv bag-drv)))))))
 
 (when (or (not (network-reachable?)) (shebang-too-long?))
   (test-skip 1))