From 5d7a8584f5c6aeed720c1115b8d46aa5a8d3157b Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Wed, 8 Oct 2014 17:15:49 +0400 Subject: ui: Move 'show-manifest-transaction' from (guix profiles). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- tests/ui.scm | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'tests/ui.scm') 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") -- cgit v1.2.3