summary refs log tree commit diff
path: root/tests/ui.scm
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2014-10-08 17:15:49 +0400
committerLudovic Courtès <ludo@gnu.org>2014-10-10 00:06:35 +0200
commit5d7a8584f5c6aeed720c1115b8d46aa5a8d3157b (patch)
tree1951ecb136601c8b3d8c440ed97da475eceb2334 /tests/ui.scm
parent12703d0854a1b16ddc73fd7c2440ef8497593a70 (diff)
downloadguix-5d7a8584f5c6aeed720c1115b8d46aa5a8d3157b.tar.gz
ui: Move 'show-manifest-transaction' from (guix profiles).
* guix/profiles.scm: Do not use (guix ui) module.
  (right-arrow, manifest-show-transaction): Move and rename to...
* guix/ui.scm (right-arrow, show-manifest-transaction): ... here.
* tests/profiles.scm ("manifest-show-transaction"): Move to...
* tests/ui.scm ("show-manifest-transaction"): ... here.
  (guile-1.8.8, guile-2.0.9): New variables.
* emacs/guix-main.scm (process-package-actions): Rename
  'manifest-show-transaction' to 'show-manifest-transaction'.
* guix/scripts/package.scm (guix-package): Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/ui.scm')
-rw-r--r--tests/ui.scm36
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/ui.scm b/tests/ui.scm
index db90cdd479..236f541be2 100644
--- a/tests/ui.scm
+++ b/tests/ui.scm
@@ -19,11 +19,14 @@
 
 (define-module (test-ui)
   #:use-module (guix ui)
+  #:use-module (guix profiles)
   #:use-module (guix store)
   #:use-module (guix derivations)
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-19)
-  #:use-module (srfi srfi-64))
+  #:use-module (srfi srfi-64)
+  #:use-module (ice-9 regex))
 
 ;; Test the (guix ui) module.
 
@@ -35,6 +38,20 @@ R6RS, Guile includes a module system, full access to POSIX system calls,
 networking support, multiple threads, dynamic linking, a foreign function call
 interface, and powerful string processing.")
 
+(define guile-1.8.8
+  (manifest-entry
+    (name "guile")
+    (version "1.8.8")
+    (item "/gnu/store/...")
+    (output "out")))
+
+(define guile-2.0.9
+  (manifest-entry
+    (name "guile")
+    (version "2.0.9")
+    (item "/gnu/store/...")
+    (output "out")))
+
 
 (test-begin "ui")
 
@@ -210,6 +227,23 @@ Second line" 24))
          ;; This should print nothing.
          (show-what-to-build store (list drv)))))))
 
+(test-assert "show-manifest-transaction"
+  (let* ((m (manifest (list guile-1.8.8)))
+         (t (manifest-transaction (install (list guile-2.0.9)))))
+    (let-values (((remove install upgrade)
+                  (manifest-transaction-effects m t)))
+      (with-store store
+        (and (string-match "guile\t1.8.8 → 2.0.9"
+                           (with-fluids ((%default-port-encoding "UTF-8"))
+                             (with-error-to-string
+                              (lambda ()
+                                (show-manifest-transaction store m t)))))
+             (string-match "guile\t1.8.8 -> 2.0.9"
+                           (with-fluids ((%default-port-encoding "ISO-8859-1"))
+                             (with-error-to-string
+                              (lambda ()
+                                (show-manifest-transaction store m t))))))))))
+
 (test-end "ui")