summary refs log tree commit diff
path: root/tests/derivations.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-04-13 00:42:07 +0200
committerLudovic Courtès <ludo@gnu.org>2014-04-13 00:42:07 +0200
commit99e17dc9274c82911c284eaeccdba08b7425f018 (patch)
treecbdb1fb94d3d2a0f543f2c0eb47241b5da799f5d /tests/derivations.scm
parentc5cd288bc71667bfd5c63a5ba958de8f49815385 (diff)
downloadguix-99e17dc9274c82911c284eaeccdba08b7425f018.tar.gz
derivations: Fix 'fixed-output-derivation?'.
Reported by Nikita Karetnikov <nikita@karetnikov.org>.

* guix/derivations.scm (fixed-output-derivation?): Fix pattern.
* tests/derivations.scm ("fixed-output-derivation?"): Add test.
Diffstat (limited to 'tests/derivations.scm')
-rw-r--r--tests/derivations.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 3903a563a8..0b785029a7 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -159,6 +159,16 @@
          ;; the contents.
          (valid-path? %store (derivation->output-path drv)))))
 
+(test-assert "fixed-output-derivation?"
+  (let* ((builder    (add-text-to-store %store "my-fixed-builder.sh"
+                                        "echo -n hello > $out" '()))
+         (hash       (sha256 (string->utf8 "hello")))
+         (drv        (derivation %store "fixed"
+                                 %bash `(,builder)
+                                 #:inputs `((,builder))
+                                 #:hash hash #:hash-algo 'sha256)))
+    (fixed-output-derivation? drv)))
+
 (test-assert "fixed-output derivation"
   (let* ((builder    (add-text-to-store %store "my-fixed-builder.sh"
                                         "echo -n hello > $out" '()))