From 8a71b9e05da3df3e2a48d8ac22cf5d772f151211 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Wed, 1 Jan 2020 00:00:00 +0100 Subject: Add a hash function --- tests/hash-unsupported.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/hash-unsupported.scm (limited to 'tests/hash-unsupported.scm') 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))) -- cgit v1.2.3