summaryrefslogtreecommitdiff
path: root/tests/pk-crypto.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-12-28 15:41:48 +0100
committerLudovic Courtès <ludo@gnu.org>2013-12-29 15:57:23 +0100
commita2cbbb743da26abc3a1bdbcd9af2d07018c2a8a6 (patch)
tree5423d5d17c66eb0f05efff49501b452decc8790f /tests/pk-crypto.scm
parent6df1fb8991bc7323dd4974a55d37f249a4e9c4a0 (diff)
downloadpatches-a2cbbb743da26abc3a1bdbcd9af2d07018c2a8a6.tar
patches-a2cbbb743da26abc3a1bdbcd9af2d07018c2a8a6.tar.gz
pk-crypto: 'canonical-sexp-nth-data' returns a symbol for "tokens".
* guix/pk-crypto.scm (token-string?): New procedure. (canonical-sexp-nth-data): Return a symbol when the element is a "token", and a bytevector otherwise. (latin1-string->bytevector): Remove. (hash-data->bytevector): Adjust accordingly. * tests/pk-crypto.scm ("canonical-sexp-nth"): Adjust accordingly. Add octet string example.
Diffstat (limited to 'tests/pk-crypto.scm')
-rw-r--r--tests/pk-crypto.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/pk-crypto.scm b/tests/pk-crypto.scm
index 85f8f9407e..8da533f5b2 100644
--- a/tests/pk-crypto.scm
+++ b/tests/pk-crypto.scm
@@ -108,8 +108,9 @@
(gc)
(test-equal "canonical-sexp-nth-data"
- '("Name" "Otto" "Meier" #f #f #f)
- (let ((lst (string->canonical-sexp "(Name Otto Meier (address Burgplatz))")))
+ `(Name Otto Meier #f ,(base16-string->bytevector "123456") #f)
+ (let ((lst (string->canonical-sexp
+ "(Name Otto Meier (address Burgplatz) #123456#)")))
(unfold (cut > <> 5)
(cut canonical-sexp-nth-data lst <>)
1+