From 99e17dc9274c82911c284eaeccdba08b7425f018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 13 Apr 2014 00:42:07 +0200 Subject: [PATCH] derivations: Fix 'fixed-output-derivation?'. Reported by Nikita Karetnikov . * guix/derivations.scm (fixed-output-derivation?): Fix pattern. * tests/derivations.scm ("fixed-output-derivation?"): Add test. --- guix/derivations.scm | 2 +- tests/derivations.scm | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/guix/derivations.scm b/guix/derivations.scm index 4d11434e3a..a3a4eae6ac 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -121,7 +121,7 @@ download with a fixed hash (aka. `fetchurl')." (match drv (($ - (($ _ (? symbol?) (? string?)))) + (("out" . ($ _ (? symbol?) (? bytevector?))))) #t) (_ #f))) 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" '()))