diff options
| author | 2025-11-23 09:34:12 -0500 | |
|---|---|---|
| committer | 2025-11-23 09:34:12 -0500 | |
| commit | fc6e1e0f425ed847ee78d313e4615b50241a924c (patch) | |
| tree | 5c002f46ac72338e1c84b56ce4871683381a305e | |
| parent | fix cycle counter (diff) | |
| -rw-r--r-- | lib/cuprate-impl.scm | 9 | ||||
| -rw-r--r-- | lib/cuprate.sld | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/cuprate-impl.scm b/lib/cuprate-impl.scm index 7140ecc..bc1e31f 100644 --- a/lib/cuprate-impl.scm +++ b/lib/cuprate-impl.scm @@ -331,6 +331,10 @@ ;;; Wrappers and semi-compatability with SRFI-64 ;;; ;;;;;;;;;;;; +(define-syntax test-assert + (syntax-rules () + ((_ name expr) (test-body name (let () #t expr))))) + (define-syntax test-named-application (syntax-rules () ((_ test-name (%name %expr) ...) @@ -415,7 +419,10 @@ (syntax-rules () ((_ name error-predicate body ...) (test-body name - (let ((p error-predicate)) + (let* ((%error-predicate error-predicate) + (p (if (eq? %error-predicate #t) + (lambda (_) #t) + %error-predicate))) (test-set! 'on-exception-in-test (lambda (ex return) (test-set! 'success? (p ex)) diff --git a/lib/cuprate.sld b/lib/cuprate.sld index a393e78..82f23c6 100644 --- a/lib/cuprate.sld +++ b/lib/cuprate.sld @@ -19,6 +19,7 @@ default-after-group default-report-group default-on-exception-in-group ;; SRFI-64 style assertions + test-assert call-as-test call-as-group define-test-application test-predicate test-binary test-named-application test-application test-body |
