#lang scheme/base
(require scheme/contract
"../base.ss"
"annotation.ss"
"result-internal.ss")
(define (create-check-success [message "Okay"] #:annotations [annotations #hasheq()])
(make-check-success message annotations))
(define (create-check-warning message #:annotations [annotations #hasheq()])
(make-check-warning message annotations))
(define (create-check-failure message #:annotations [annotations #hasheq()])
(make-check-failure message annotations))
(define (create-check-fatal message exn #:annotations [annotations #hasheq()])
(make-check-fatal message annotations exn))
(define (check-result-exn result)
(if (check-fatal? result)
(check-fatal-exn result)
#f))
(provide (except-out (all-from-out "result-internal.ss")
make-check-success
make-check-warning
make-check-failure
make-check-fatal))
(provide/contract
[check-result-exn (-> check-result? (or/c exn? false/c))]
[rename create-check-success make-check-success (->* () (string? #:annotations annotations/c) check-success?)]
[rename create-check-warning make-check-warning (->* (string?) (#:annotations annotations/c) check-warning?)]
[rename create-check-failure make-check-failure (->* (string?) (#:annotations annotations/c) check-failure?)]
[rename create-check-fatal make-check-fatal (->* (string? exn?) (#:annotations annotations/c) check-fatal?)])