diff options
| author | 2025-09-26 10:15:09 -0400 | |
|---|---|---|
| committer | 2025-09-26 10:15:09 -0400 | |
| commit | a1962c6bcd129d8bc3e66873992d86c47f951192 (patch) | |
| tree | 10c13e00c1e71872ff49b037b59128b1c767b552 /lib | |
| parent | test-application: add forms as they are evaluated, and only store the whole e... (diff) | |
add expect-to-fail
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/conspire.scm | 15 | ||||
| -rw-r--r-- | lib/conspire.sld | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/conspire.scm b/lib/conspire.scm index 7d8bfcd..130218f 100644 --- a/lib/conspire.scm +++ b/lib/conspire.scm @@ -389,12 +389,25 @@ (lambda () (thunk) #f)))))) (call-as-test name outer-thunk)) -(define-syntax with-test-error +(define-syntax test-error (syntax-rules () ((_ name error-predicate body ...) (call-as-test-error name error-predicate (lambda () body ...))))) +(define-syntax expect-to-fail + (syntax-rules () + ((_ body ...) + (let ((outer-after-test (test-ref 'after-test))) + (test-group #f + (test-set! 'after-test + (lambda (dto dict) + (outer-after-test dto + (dict-update! dto dict + 'success? + not)))) + (let () body ...)))))) + (define-syntax test-skip-all (syntax-rules () ((_ body ...) diff --git a/lib/conspire.sld b/lib/conspire.sld index 430a2a7..0b50d94 100644 --- a/lib/conspire.sld +++ b/lib/conspire.sld @@ -41,7 +41,7 @@ ;; SRFI-64 style assertions test-application test-assert test-equal test-eqv test-eq test-approximate - call-as-test-error with-test-error + call-as-test-error test-error expect-to-fail test-skip-all test-group with-test-group-cleanup |
