From 79601521fceb6b2f76d87cf3df45a76e43b1ffcf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 30 Aug 2014 21:52:32 +0200 Subject: profiles: Compute transaction effects in a functional way. * guix/profiles.scm (manifest-transaction-effects): New procedure. (manifest-show-transaction): Use it instead of locally computing it. * tests/profiles.scm (glibc): New variable. ("manifest-transaction-effects"): New test. --- tests/profiles.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/profiles.scm b/tests/profiles.scm index 047c5ba49b..d88def32fd 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -26,6 +26,7 @@ #:use-module (guix derivations) #:use-module (gnu packages bootstrap) #:use-module (ice-9 match) + #:use-module (srfi srfi-11) #:use-module (srfi srfi-64)) ;; Test the (guix profiles) module. @@ -53,6 +54,13 @@ (manifest-entry (inherit guile-2.0.9) (output "debug"))) +(define glibc + (manifest-entry + (name "glibc") + (version "2.19") + (item "/gnu/store/...") + (output "out"))) + (test-begin "profiles") @@ -136,6 +144,17 @@ (equal? m1 m2) (null? (manifest-entries m3))))) +(test-assert "manifest-transaction-effects" + (let* ((m0 (manifest (list guile-1.8.8))) + (t (manifest-transaction + (install (list guile-2.0.9 glibc)) + (remove (list (manifest-pattern (name "coreutils"))))))) + (let-values (((remove install upgrade) + (manifest-transaction-effects m0 t))) + (and (null? remove) + (equal? (list glibc) install) + (equal? (list guile-2.0.9) upgrade))))) + (test-assert "profile-derivation" (run-with-store %store (mlet* %store-monad -- cgit 1.4.1