From 3d9ea605c8dfb7fc43689e12975218b032b3175a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 28 Aug 2020 15:05:17 +0200 Subject: store: 'with-store' returns as many values as its body. Fixes . Reported by Ricardo Wurmus . * guix/store.scm (call-with-store)[thunk]: Wrap call to PROC in 'call-with-values'. * tests/store.scm ("with-store, multiple values"): New test. --- tests/store.scm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/store.scm') diff --git a/tests/store.scm b/tests/store.scm index ee3e01f33b..e168d3dcf6 100644 --- a/tests/store.scm +++ b/tests/store.scm @@ -141,6 +141,15 @@ (string-append (%store-prefix) "/" (make-string 32 #\e) "-foobar")))) +(test-equal "with-store, multiple values" ; + '(1 2 3) + (call-with-values + (lambda () + (with-store s + (add-text-to-store s "foo" "bar") + (values 1 2 3))) + list)) + (test-assert "valid-path? error" (with-store s (guard (c ((store-protocol-error? c) #t)) -- cgit 1.4.1