Fix the `build-expression->derivation' fixed-output test.

* tests/derivations.scm ("build-expression->derivation"): Fix the
  builder to actually pass a bytevector to `put-bytevector'.
master
Ludovic Courtès 2012-06-11 23:02:39 +02:00
parent 9809055707
commit 0e383c76ce
1 changed files with 9 additions and 8 deletions

View File

@ -214,14 +214,15 @@
(test-assert "build-expression->derivation for fixed-output derivation" (test-assert "build-expression->derivation for fixed-output derivation"
(let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz") (let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")
(builder `(begin (builder
(use-modules (web client) (web uri) `(begin
(rnrs io ports)) (use-modules (web client) (web uri)
(let ((bv (http-get (string->uri ,url) (rnrs io ports) (srfi srfi-11))
#:decode-body? #f))) (let-values (((resp bv)
(call-with-output-file %output (http-get (string->uri ,url) #:decode-body? #f)))
(lambda (p) (call-with-output-file %output
(put-bytevector p bv)))))) (lambda (p)
(put-bytevector p bv))))))
(drv-path (build-expression->derivation (drv-path (build-expression->derivation
%store "hello-2.8.tar.gz" (%current-system) builder '() %store "hello-2.8.tar.gz" (%current-system) builder '()
#:hash (nix-base32-string->bytevector #:hash (nix-base32-string->bytevector