summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-02-09 17:18:48 +0100
committerLudovic Courtès <ludo@gnu.org>2015-02-09 18:18:41 +0100
commit3bea13bb1f571445185d376f76e1785a5777282e (patch)
treeff224992451138555296d29c18ff2ac9ede30a56 /tests
parentcde1e967cfc0849c7010eda0bc700dadf222275f (diff)
downloadguix-3bea13bb1f571445185d376f76e1785a5777282e.tar.gz
profiles: Report "pseudo-upgrades" as upgrades, not downgrades.
Reported by Andreas Enge <andreas@enge.fr>
at <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19764#19>.

* guix/profiles.scm (manifest-transaction-effects): Use 'version>=?'
  instead of 'version>?'.
* tests/profiles.scm ("manifest-transaction-effects and
  pseudo-upgrades"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/profiles.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/profiles.scm b/tests/profiles.scm
index c210123f74..833b08b455 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -169,6 +169,14 @@
       (and (null? remove) (null? install) (null? upgrade)
            (equal? (list (cons guile-2.0.9 guile-1.8.8)) downgrade)))))
 
+(test-assert "manifest-transaction-effects and pseudo-upgrades"
+  (let* ((m0 (manifest (list guile-2.0.9)))
+         (t  (manifest-transaction (install (list guile-2.0.9)))))
+    (let-values (((remove install upgrade downgrade)
+                  (manifest-transaction-effects m0 t)))
+      (and (null? remove) (null? install) (null? downgrade)
+           (equal? (list (cons guile-2.0.9 guile-2.0.9)) upgrade)))))
+
 (test-assertm "profile-derivation"
   (mlet* %store-monad
       ((entry ->   (package->manifest-entry %bootstrap-guile))