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 13:06:24 +0200
commit0329c4d71505da1854dd885fe9ae8a61ed7d19c7 (patch)
tree34a863b9be5dd5c7008bdb1cc93a475d70e84ef7 /tests/hash-unsupported.scm
parent0fc79ba87996e3df6044cc4f3b4bffa03fe9d529 (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)))