summary refs log tree commit diff
path: root/tests/guix-package.sh
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-11-11 17:13:20 +0100
committerLudovic Courtès <ludo@gnu.org>2018-11-11 23:53:29 +0100
commit652163154c06b47936a453f44ea35938789718de (patch)
tree99cfd45eb491c64b891182961261487d6a781e08 /tests/guix-package.sh
parent9c001c07d4c483a4a6b7c7ff50b1119d3fd4b90f (diff)
downloadguix-652163154c06b47936a453f44ea35938789718de.tar.gz
guix package: '--show' errors when asked for a non-existent package.
Fixes <https://bugs.gnu.org/33323>.
Reported by swedebugia <swedebugia@riseup.net>.

* guix/scripts/package.scm (process-query): Call 'leave' when
'find-packages-by-name' returns the empty list.
* tests/guix-package.sh: Test it.
Diffstat (limited to 'tests/guix-package.sh')
-rw-r--r--tests/guix-package.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index f7dfbfad00..7eeb4304d1 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -106,6 +106,10 @@ guix package --show=guile | grep "^name: guile"
 # Ensure `--show' doesn't fail for packages with non-package inputs.
 guix package --show=texlive
 
+# Fail for non-existent packages or package/version pairs.
+if guix package --show=does-not-exist; then false; else true; fi
+if guix package --show=emacs@42; then false; else true; fi
+
 # Search.
 LC_MESSAGES=C
 export LC_MESSAGES