From 59fbeb8cae02032a2f8b7966ab52545817f3ed88 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 15 Oct 2013 23:31:22 +0200 Subject: records: define-record-type*: Field bindings are bound with 'let*'. * guix/records.scm (define-record-type*): Wrap field bindings in a 'let*', not in a 'letrec*', which turned out to be pointlessly inconvenient. * tests/records.scm: Adjust test names accordingly. --- tests/records.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/records.scm b/tests/records.scm index 851ff7bde..15709ac32 100644 --- a/tests/records.scm +++ b/tests/records.scm @@ -36,9 +36,9 @@ (match (foo (bar 1)) (($ 1 42) #t))))) -(test-assert "define-record-type* with letrec* behavior" +(test-assert "define-record-type* with let* behavior" ;; Make sure field initializers can refer to each other as if they were in - ;; a `letrec*'. + ;; a 'let*'. (begin (define-record-type* bar make-bar foo? @@ -69,7 +69,7 @@ (equal? c d) (match e (($ 42 77) #t)))))) -(test-assert "define-record-type* & inherit & letrec* behavior" +(test-assert "define-record-type* & inherit & let* behavior" (begin (define-record-type* foo make-foo foo? -- cgit v1.3 From d0dc4907d6dac82ba482472845e83d7411c74ed5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 30 Oct 2013 19:09:32 +0100 Subject: derivations: 'derivation-path->output-path' honors the 'output' parameter. * guix/derivations.scm (derivation-path->output-path): Pass OUTPUT. * tests/derivations.scm ("multiple-output derivation, derivation-path->output-path"): New test. --- guix/derivations.scm | 3 ++- tests/derivations.scm | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/guix/derivations.scm b/guix/derivations.scm index 433a8f145..48e9d5ec0 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -441,7 +441,8 @@ that form." (lambda* (path #:optional (output "out")) "Read the derivation from PATH (`/nix/store/xxx.drv'), and return the store path of its output OUTPUT." - (derivation->output-path (call-with-input-file path read-derivation))))) + (derivation->output-path (call-with-input-file path read-derivation) + output)))) (define (derivation-path->output-paths path) "Read the derivation from PATH (`/nix/store/xxx.drv'), and return the diff --git a/tests/derivations.scm b/tests/derivations.scm index 4756fb9cb..1b32ab5ff 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -260,6 +260,23 @@ (and (eq? 'one (call-with-input-file one read)) (eq? 'two (call-with-input-file two read))))))) +(test-assert "multiple-output derivation, derivation-path->output-path" + (let* ((builder (add-text-to-store %store "builder.sh" + "echo one > $out ; echo two > $second" + '())) + (drv (derivation %store "multiple" + %bash `(,builder) + #:outputs '("out" "second"))) + (drv-file (derivation-file-name drv)) + (one (derivation->output-path drv "out")) + (two (derivation->output-path drv "second")) + (first (derivation-path->output-path drv-file "out")) + (second (derivation-path->output-path drv-file "second"))) + (and (not (string=? one two)) + (string-suffix? "-second" two) + (string=? first one) + (string=? second two)))) + (test-assert "user of multiple-output derivation" ;; Check whether specifying several inputs coming from the same ;; multiple-output derivation works. -- cgit v1.3