summaryrefslogtreecommitdiff
path: root/tests/hash-unsupported.scm
diff options
context:
space:
mode:
authorVivien Kraus <vivien@planete-kraus.eu>2020-01-01 00:00:00 +0100
committerVivien Kraus <vivien@planete-kraus.eu>2021-06-19 15:44:24 +0200
commit2fc254c809e42029f28982404870604633b35521 (patch)
tree7d7d32a3e7560bb165fe1ea2f6f96ad82a7e3f4a /tests/hash-unsupported.scm
parent6bc2ce4c55af6d3f3af7be494c149cbe33d6e08e (diff)
Add a hash function
Diffstat (limited to 'tests/hash-unsupported.scm')
-rw-r--r--tests/hash-unsupported.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/hash-unsupported.scm b/tests/hash-unsupported.scm
new file mode 100644
index 0000000..c52959a
--- /dev/null
+++ b/tests/hash-unsupported.scm
@@ -0,0 +1,21 @@
+(use-modules
+ (webid-oidc testing)
+ (webid-oidc errors)
+ ((webid-oidc stubs) #:prefix stubs:)
+ (rnrs bytevectors))
+
+(with-test-environment
+ "hash-unsupported"
+ (lambda ()
+ (with-exception-handler
+ (lambda (error)
+ (unless ((record-predicate &unsupported-alg) error)
+ (exit 1))
+ (let ((value ((record-accessor &unsupported-alg 'value) error)))
+ (unless (eq? value 'SHA-1024)
+ (exit 2))))
+ (lambda ()
+ (stubs:hash 'SHA-1024 "hello :)")
+ (exit 3))
+ #:unwind? #t
+ #:unwind-for-type &unsupported-alg)))