summaryrefslogtreecommitdiff
path: root/tests/hash-unsupported.scm
diff options
context:
space:
mode:
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)))