From 6d800a80eaa2a221ee44617fdd702bf7c92f22ed Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 9 Jun 2012 16:34:18 +0200 Subject: Add `base16-string->bytevector'. * guix/utils.scm (base16-string->bytevector): New procedure. * tests/utils.scm ("bytevector->base16-string->bytevector"): New test. --- tests/utils.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/utils.scm b/tests/utils.scm index edea11db72..db4eb5a340 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -62,6 +62,13 @@ (define-module (test-utils) ;; Examples from RFC 4648. (map string->utf8 '("" "f" "fo" "foo" "foob" "fooba" "foobar")))) +(test-assert "bytevector->base16-string->bytevector" + (every (lambda (bv) + (equal? (base16-string->bytevector + (bytevector->base16-string bv)) + bv)) + (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 -- cgit v1.2.3