diff options
author | Alex Kost <alezost@gmail.com> | 2014-08-14 00:03:53 +0400 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-08-19 22:55:22 +0200 |
commit | 343745c80ac69ca2b3d14748fa65ad2ea4e50451 (patch) | |
tree | a883c50be418d464c3be8176a3bbd698d0f398fd /tests | |
parent | 667b2508464374a01db3588504b981ec9266a2ea (diff) |
profiles: Add 'manifest-transaction'.
* guix/profiles.scm (<manifest-transaction>): New record-type.
(manifest-perform-transaction): New procedure.
(manifest-show-transaction): New procedure.
* tests/profiles.scm ("manifest-perform-transaction"): New test.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/profiles.scm | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/profiles.scm b/tests/profiles.scm index b2919d7315..e1f1eefee7 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014 Alex Kost <alezost@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,7 +27,7 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-64)) -;; Test the (guix profile) module. +;; Test the (guix profiles) module. (define %store (open-connection)) @@ -122,6 +123,25 @@ (_ #f)) (equal? m3 m4)))) +(test-assert "manifest-perform-transaction" + (let* ((m0 (manifest (list guile-2.0.9 guile-2.0.9:debug))) + (t1 (manifest-transaction + (install (list guile-1.8.8)) + (remove (list (manifest-pattern (name "guile") + (output "debug")))))) + (t2 (manifest-transaction + (remove (list (manifest-pattern (name "guile") + (version "2.0.9") + (output #f)))))) + (m1 (manifest-perform-transaction m0 t1)) + (m2 (manifest-perform-transaction m1 t2)) + (m3 (manifest-perform-transaction m0 t2))) + (and (match (manifest-entries m1) + ((($ <manifest-entry> "guile" "1.8.8" "out")) #t) + (_ #f)) + (equal? m1 m2) + (null? (manifest-entries m3))))) + (test-assert "profile-derivation" (run-with-store %store (mlet* %store-monad |