aboutsummaryrefslogtreecommitdiff
path: root/tests/pk-crypto.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-12-21 00:09:51 +0100
committerLudovic Courtès <ludo@gnu.org>2013-12-21 00:10:09 +0100
commit0a66781eee68efe71437ac0116172c873351eede (patch)
tree1e656cb4d2167c75075717fd6097b08a81965a48 /tests/pk-crypto.scm
parent526382ff92b20f6c651f03711c160c0c88264b88 (diff)
downloadgnu-guix-0a66781eee68efe71437ac0116172c873351eede.tar
gnu-guix-0a66781eee68efe71437ac0116172c873351eede.tar.gz
build: Adjust pk-crypto tests to Libgcrypt 1.5.3.
Reported by Andreas Enge <andreas@enge.fr>. * tests/pk-crypto.scm ("string->gcry-sexp->string"): Remove "#C0FFEE#" from SEXPS. ("gcry-sexp-nth"): Start at index 1.
Diffstat (limited to 'tests/pk-crypto.scm')
-rw-r--r--tests/pk-crypto.scm14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/pk-crypto.scm b/tests/pk-crypto.scm
index 7c54e729ad..eddd5c4945 100644
--- a/tests/pk-crypto.scm
+++ b/tests/pk-crypto.scm
@@ -50,7 +50,12 @@
(test-begin "pk-crypto")
-(let ((sexps '("(foo bar)" "#C0FFEE#"
+(let ((sexps '("(foo bar)"
+
+ ;; In Libgcrypt 1.5.3 the following integer is rendered as
+ ;; binary, whereas in 1.6.0 it's rendered as is (hexadecimal.)
+ ;;"#C0FFEE#"
+
"(genkey \n (rsa \n (nbits \"1024\")\n )\n )")))
(test-equal "string->gcry-sexp->string"
sexps
@@ -88,14 +93,17 @@
(gc)
(test-equal "gcry-sexp-nth"
- '(#f "(b pqr)" "(c \"456\")" "(d xyz)" #f #f)
+ '("(b pqr)" "(c \"456\")" "(d xyz)" #f #f)
+
(let ((lst (string->gcry-sexp "(a (b 3:pqr) (c 3:456) (d 3:xyz))")))
+ ;; XXX: In Libgcrypt 1.5.3, (gcry-sexp-nth lst 0) returns LST, whereas in
+ ;; 1.6.0 it returns #f.
(map (lambda (sexp)
(and sexp (string-trim-both (gcry-sexp->string sexp))))
(unfold (cut > <> 5)
(cut gcry-sexp-nth lst <>)
1+
- 0))))
+ 1))))
(gc)