summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-02-14 00:20:28 +0100
committerMarius Bakke <mbakke@fastmail.com>2019-02-14 00:20:28 +0100
commit6901878894e9c6405fa811c512a32f448e8b9fa2 (patch)
tree5b04c4234f4022533692c36a83047ec9801aada9 /tests
parentbaf766a7ff9db45c707b4539176f2143fbd90efd (diff)
parent58c6a93d9d60660d8425d8c52d4b73a42d4a5b55 (diff)
downloadguix-6901878894e9c6405fa811c512a32f448e8b9fa2.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'tests')
-rw-r--r--tests/inferior.scm22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/inferior.scm b/tests/inferior.scm
index d5a894ca8f..71ebf8f59b 100644
--- a/tests/inferior.scm
+++ b/tests/inferior.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -89,6 +89,26 @@
            (close-inferior inferior)
            result))))
 
+(test-equal "inferior-available-packages"
+  (take (sort (fold-available-packages
+               (lambda* (name version result
+                              #:key supported? deprecated?
+                              #:allow-other-keys)
+                 (if (and supported? (not deprecated?))
+                     (alist-cons name version result)
+                     result))
+               '())
+              (lambda (x y)
+                (string<? (car x) (car y))))
+        10)
+  (let* ((inferior (open-inferior %top-builddir
+                                  #:command "scripts/guix"))
+         (packages (inferior-available-packages inferior)))
+    (close-inferior inferior)
+    (take (sort packages (lambda (x y)
+                           (string<? (car x) (car y))))
+          10)))
+
 (test-equal "lookup-inferior-packages"
   (let ((->list (lambda (package)
                   (list (package-name package)