mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
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.
This commit is contained in:
parent
526382ff92
commit
0a66781eee
1 changed files with 11 additions and 3 deletions
|
@ -50,7 +50,12 @@ (define %key-pair
|
||||||
|
|
||||||
(test-begin "pk-crypto")
|
(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 )")))
|
"(genkey \n (rsa \n (nbits \"1024\")\n )\n )")))
|
||||||
(test-equal "string->gcry-sexp->string"
|
(test-equal "string->gcry-sexp->string"
|
||||||
sexps
|
sexps
|
||||||
|
@ -88,14 +93,17 @@ (define %key-pair
|
||||||
(gc)
|
(gc)
|
||||||
|
|
||||||
(test-equal "gcry-sexp-nth"
|
(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))")))
|
(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)
|
(map (lambda (sexp)
|
||||||
(and sexp (string-trim-both (gcry-sexp->string sexp))))
|
(and sexp (string-trim-both (gcry-sexp->string sexp))))
|
||||||
(unfold (cut > <> 5)
|
(unfold (cut > <> 5)
|
||||||
(cut gcry-sexp-nth lst <>)
|
(cut gcry-sexp-nth lst <>)
|
||||||
1+
|
1+
|
||||||
0))))
|
1))))
|
||||||
|
|
||||||
(gc)
|
(gc)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue