summaryrefslogtreecommitdiff
path: root/tests/base64-error.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/base64-error.scm')
-rw-r--r--tests/base64-error.scm22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/base64-error.scm b/tests/base64-error.scm
new file mode 100644
index 0000000..096e1e8
--- /dev/null
+++ b/tests/base64-error.scm
@@ -0,0 +1,22 @@
+(use-modules
+ (webid-oidc testing)
+ ((webid-oidc stubs) #:prefix stubs:)
+ (webid-oidc errors)
+ (rnrs bytevectors))
+
+(with-test-environment
+ "base64-error"
+ (lambda ()
+ (let ((test "hello :)"))
+ (unless
+ (with-exception-handler
+ (lambda (error)
+ (unless ((record-predicate &not-base64) error)
+ (exit 1))
+ #t)
+ (lambda ()
+ (stubs:base64-decode test)
+ #f)
+ #:unwind? #t
+ #:unwind-for-type &not-base64)
+ (exit 2)))))