summaryrefslogtreecommitdiff
path: root/tests/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-08-28 15:05:17 +0200
committerLudovic Courtès <ludo@gnu.org>2020-08-28 23:27:53 +0200
commit3d9ea605c8dfb7fc43689e12975218b032b3175a (patch)
tree5bd465a5cfa605ff65125db071e62f80246d16dd /tests/store.scm
parentb6308409206af78356ea7d1b2c4613ca1ee4315c (diff)
store: 'with-store' returns as many values as its body.
Fixes <https://bugs.gnu.org/42912>. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/store.scm (call-with-store)[thunk]: Wrap call to PROC in 'call-with-values'. * tests/store.scm ("with-store, multiple values"): New test.
Diffstat (limited to 'tests/store.scm')
-rw-r--r--tests/store.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/store.scm b/tests/store.scm
index ee3e01f33b1..e168d3dcf68 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -141,6 +141,15 @@
141 (string-append (%store-prefix) "/" 141 (string-append (%store-prefix) "/"
142 (make-string 32 #\e) "-foobar")))) 142 (make-string 32 #\e) "-foobar"))))
143 143
144(test-equal "with-store, multiple values" ;<https://bugs.gnu.org/42912>
145 '(1 2 3)
146 (call-with-values
147 (lambda ()
148 (with-store s
149 (add-text-to-store s "foo" "bar")
150 (values 1 2 3)))
151 list))
152
144(test-assert "valid-path? error" 153(test-assert "valid-path? error"
145 (with-store s 154 (with-store s
146 (guard (c ((store-protocol-error? c) #t)) 155 (guard (c ((store-protocol-error? c) #t))