summaryrefslogtreecommitdiff
path: root/tests/key.scm
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2015-11-23 11:32:11 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2015-11-23 11:32:11 +0300
commite6c070663e9f7d085e50854d1cc8f3c2428aad55 (patch)
tree38dc192458b58d11a35464d12a4872ac43958582 /tests/key.scm
parenttests/server-client.scm: Don't exit explicitly from client procs (diff)
downloadguile-ssh-e6c070663e9f7d085e50854d1cc8f3c2428aad55.tar.gz
tests/key.scm: Split some tests
* tests/key.scm ("public-key->string", "string->public-key"): Split tests into more fine-grained ones. Make use of 'test-equal' from SRFI-64.
Diffstat (limited to 'tests/key.scm')
-rw-r--r--tests/key.scm40
1 files changed, 27 insertions, 13 deletions
diff --git a/tests/key.scm b/tests/key.scm
index 8f3ab34..a8b024a 100644
--- a/tests/key.scm
+++ b/tests/key.scm
@@ -116,21 +116,35 @@
(define %ecdsakey-pub-string
"AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHcpje/fp21KjuZFKgmKAAwHeYJ6e3ny4LwEVjZr8hOCVlBvqj7/krVqxbwZI7EcowbpYI1F8ZszS7zfUhKT3U4=")
-(test-assert "public-key->string"
- (and (string=? (public-key->string *rsa-pub-key*) %rsakey-pub-string)
- (string=? (public-key->string *dsa-pub-key*) %dsakey-pub-string)
- (when-openssl
- (string=? (public-key->string *ecdsa-pub-key*) %ecdsakey-pub-string))))
+
+(test-equal "public-key->string, RSA"
+ (public-key->string *rsa-pub-key*)
+ %rsakey-pub-string)
-(test-assert "string->public-key"
- (and (string=? (public-key->string (string->public-key %rsakey-pub-string 'rsa))
- %rsakey-pub-string)
- (string=? (public-key->string (string->public-key %dsakey-pub-string 'dss))
- %dsakey-pub-string)
- (when-openssl
- (string=? (public-key->string (string->public-key %ecdsakey-pub-string 'ecdsa))
- %ecdsakey-pub-string))))
+(test-equal "public-key->string, DSA"
+ (public-key->string *dsa-pub-key*)
+ %dsakey-pub-string)
+(when-openssl
+ (test-equal "public-key->string, ECDSA"
+ (public-key->string *ecdsa-pub-key*)
+ %ecdsakey-pub-string))
+
+
+(test-equal "string->public-key, RSA"
+ (public-key->string (string->public-key %rsakey-pub-string 'rsa))
+ %rsakey-pub-string)
+
+(test-equal "string->public-key, DSA"
+ (public-key->string (string->public-key %dsakey-pub-string 'dss))
+ %dsakey-pub-string)
+
+(when-openssl
+ (test-equal "string->public-key, ECDSA"
+ (public-key->string (string->public-key %ecdsakey-pub-string 'ecdsa))
+ %ecdsakey-pub-string))
+
+
(test-assert "make-keypair"
(and (let ((key (make-keypair 'rsa 1024)))
(and (key? key)