summaryrefslogtreecommitdiff
path: root/tests/base32.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-12-13 22:14:25 +0100
committerLudovic Courtès <ludo@gnu.org>2012-12-13 22:14:25 +0100
commit1e9824513c570370638b1bfe33bf1dba1f12be4a (patch)
treecb7bd7f0bebd42dbeabf2c8f09ae1d5144ac969b /tests/base32.scm
parent70915c1a2ef72e7350b2a29d1d93e30643bce6f3 (diff)
parentb35c0f866c83288e64dcf5839d908705d416c317 (diff)
Merge branch 'nix-integration'
Conflicts: tests/guix-package.sh
Diffstat (limited to 'tests/base32.scm')
-rw-r--r--tests/base32.scm18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/base32.scm b/tests/base32.scm
index b8b9ebb0dd..d1bbaa1764 100644
--- a/tests/base32.scm
+++ b/tests/base32.scm
@@ -23,15 +23,24 @@
#:use-module (srfi srfi-64)
#:use-module (ice-9 rdelim)
#:use-module (ice-9 popen)
+ #:use-module (ice-9 match)
#:use-module (rnrs bytevectors)
#:use-module (rnrs io ports))
;; Test the (guix base32) module.
(define %nix-hash
- (or (getenv "NIX_HASH")
+ (or (and=> (getenv "NIX_HASH")
+ (match-lambda
+ ("" #f)
+ (val val)))
"nix-hash"))
+(define %have-nix-hash?
+ ;; Note: Use `system', not `system*', because of <http://bugs.gnu.org/13166>.
+ (false-if-exception
+ (zero? (system (string-append %nix-hash " --version")))))
+
(test-begin "base32")
(test-assert "bytevector->base32-string"
@@ -67,10 +76,9 @@
;; Examples from RFC 4648.
(map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar"))))
-;; The following tests requires `nix-hash' in $PATH.
-(test-skip (if (false-if-exception (system* %nix-hash "--version"))
- 0
- 1))
+;; The following test requires `nix-hash' in $PATH.
+(unless %have-nix-hash?
+ (test-skip 1))
(test-assert "sha256 & bytevector->nix-base32-string"
(let ((file (search-path %load-path "tests/test.drv")))