diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-06-30 16:37:19 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-06-30 16:37:19 +0200 |
commit | 6b1891b0a174f0fcbf26d4f404d3c2b4c63eb3e2 (patch) | |
tree | 25c62329c8b895c0abf1b703e566521e46bf55ac /tests/packages.scm | |
parent | 39b9372ca7077afa938291f6cb3c88798e1cb704 (diff) | |
download | guix-6b1891b0a174f0fcbf26d4f404d3c2b4c63eb3e2.tar guix-6b1891b0a174f0fcbf26d4f404d3c2b4c63eb3e2.tar.gz |
Add (distro) with a package searching facility.
* Makefile.am (MODULES): Add `distro.scm'.
* distro.scm: New file.
* po/POTFILES.in: Add it.
* tests/packages.scm ("find-packages-by-name", "find-packages-by-name
with version"): New tests.
Diffstat (limited to 'tests/packages.scm')
-rw-r--r-- | tests/packages.scm | 15 |
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") |