diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2019-02-12 22:17:11 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2019-02-12 23:30:16 +0100 |
| commit | 739380542da7e434c581ec620edeb4348d6ece89 (patch) | |
| tree | 85d7c3d1caf3ead51829016fb3787116cfbab588 /tests/inferior.scm | |
| parent | 46765f82dbd541a6ab48ba84816dbcf701d8714b (diff) | |
inferior: Add 'inferior-available-packages'.
* guix/inferior.scm (inferior-available-packages): New procedure.
* tests/inferior.scm ("inferior-available-packages"): New test.
Diffstat (limited to 'tests/inferior.scm')
| -rw-r--r-- | tests/inferior.scm | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/inferior.scm b/tests/inferior.scm index d5a894ca8ff..71ebf8f59be 100644 --- a/tests/inferior.scm +++ b/tests/inferior.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -89,6 +89,26 @@ | |||
| 89 | (close-inferior inferior) | 89 | (close-inferior inferior) |
| 90 | result)))) | 90 | result)))) |
| 91 | 91 | ||
| 92 | (test-equal "inferior-available-packages" | ||
| 93 | (take (sort (fold-available-packages | ||
| 94 | (lambda* (name version result | ||
| 95 | #:key supported? deprecated? | ||
| 96 | #:allow-other-keys) | ||
| 97 | (if (and supported? (not deprecated?)) | ||
| 98 | (alist-cons name version result) | ||
| 99 | result)) | ||
| 100 | '()) | ||
| 101 | (lambda (x y) | ||
| 102 | (string<? (car x) (car y)))) | ||
| 103 | 10) | ||
| 104 | (let* ((inferior (open-inferior %top-builddir | ||
| 105 | #:command "scripts/guix")) | ||
| 106 | (packages (inferior-available-packages inferior))) | ||
| 107 | (close-inferior inferior) | ||
| 108 | (take (sort packages (lambda (x y) | ||
| 109 | (string<? (car x) (car y)))) | ||
| 110 | 10))) | ||
| 111 | |||
| 92 | (test-equal "lookup-inferior-packages" | 112 | (test-equal "lookup-inferior-packages" |
| 93 | (let ((->list (lambda (package) | 113 | (let ((->list (lambda (package) |
| 94 | (list (package-name package) | 114 | (list (package-name package) |
