summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-02-12 18:59:11 +0100
committerLudovic Courtès <ludo@gnu.org>2016-02-12 21:54:25 +0100
commit98a7b528d61cfca3f8bfc827cf94f4716ab75abd (patch)
tree0f6b1d8c8eaf02d2ad6eca3d8ba673e57fc648be /tests
parent0d0bcaa08e8473693dab01ebf417b9e9fcefa087 (diff)
downloadguix-98a7b528d61cfca3f8bfc827cf94f4716ab75abd.tar.gz
store: Add monadic access to '%current-system'.
* guix/store.scm (current-system, set-current-system): New procedures.
* tests/store.scm ("current-system"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/store.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/store.scm b/tests/store.scm
index 394c06bc0f..9d651ce5a9 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -837,6 +837,15 @@
          (file (add %store "foo" "Lowered.")))
     (call-with-input-file file get-string-all)))
 
+(test-equal "current-system"
+  "bar"
+  (parameterize ((%current-system "frob"))
+    (run-with-store %store
+      (mbegin %store-monad
+        (set-current-system "bar")
+        (current-system))
+      #:system "foo")))
+
 (test-assert "query-path-info"
   (let* ((ref (add-text-to-store %store "ref" "foo"))
          (item (add-text-to-store %store "item" "bar" (list ref)))