summary refs log tree commit diff
path: root/tests/packages.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/packages.scm')
-rw-r--r--tests/packages.scm15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index 8df58a8bd2..eef7d32a35 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -22,8 +22,11 @@
   #:use-module (guix utils)
   #:use-module (guix derivations)
   #:use-module (guix packages)
+  #:use-module (distro)
   #:use-module (distro base)
-  #:use-module (srfi srfi-64))
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-64)
+  #:use-module (ice-9 match))
 
 ;; Test the high-level packaging layer.
 
@@ -43,6 +46,16 @@
          (and (build-derivations %store (list drv))
               (file-exists? (string-append out "/bin/hello"))))))
 
+(test-assert "find-packages-by-name"
+  (match (find-packages-by-name "hello")
+    (((? (cut eq? hello <>))) #t)
+    (wrong (pk 'find-packages-by-name wrong #f))))
+
+(test-assert "find-packages-by-name with version"
+  (match (find-packages-by-name "hello" (package-version hello))
+    (((? (cut eq? hello <>))) #t)
+    (wrong (pk 'find-packages-by-name wrong #f))))
+
 (test-end "packages")