diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-05-19 23:08:43 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-05-19 23:52:40 +0200 |
commit | 52ddf2ae6fb369ec64aae75fc311d6cc57a713b6 (patch) | |
tree | 7b7f02838ff6367b4819f6238a85f4fc98e7461e /tests/ui.scm | |
parent | 79b0d4e1049afe1ceb5d420a9ceb11c230a1da24 (diff) | |
download | patches-52ddf2ae6fb369ec64aae75fc311d6cc57a713b6.tar patches-52ddf2ae6fb369ec64aae75fc311d6cc57a713b6.tar.gz |
ui: Gracefully deal with zero-output derivations.
* guix/ui.scm (show-what-to-build)[built-or-substitutable?]: New
procedure. Check whether OUT is #f.
Use it.
* tests/ui.scm ("show-what-to-build, zero outputs"): New test.
Diffstat (limited to 'tests/ui.scm')
-rw-r--r-- | tests/ui.scm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui.scm b/tests/ui.scm index 886223ef54..4bf7a779c5 100644 --- a/tests/ui.scm +++ b/tests/ui.scm @@ -19,6 +19,8 @@ (define-module (test-ui) #:use-module (guix ui) + #:use-module (guix store) + #:use-module (guix derivations) #:use-module (srfi srfi-1) #:use-module (srfi srfi-19) #:use-module (srfi srfi-64)) @@ -189,6 +191,16 @@ interface, and powerful string processing.") (lambda args #t))) +(test-equal "show-what-to-build, zero outputs" + "" + (with-store store + (let ((drv (derivation store "zero" "/bin/sh" '() + #:outputs '()))) + (with-error-to-string + (lambda () + ;; This should print nothing. + (show-what-to-build store (list drv))))))) + (test-end "ui") |