diff options
| author | 2025-09-21 23:57:14 -0400 | |
|---|---|---|
| committer | 2025-09-21 23:57:14 -0400 | |
| commit | 65156de526ff7b1e9dd93bba43084a2654f63b0f (patch) | |
| tree | d3d5b550560aac6923739a6967dccc3538a25d49 | |
| parent | replace with-test-assert with test-assert for better compat with SRFI-64 (diff) | |
test-application: add forms as they are evaluated, and only store the whole evaluated expression quoted
| -rw-r--r-- | README.md | 11 | ||||
| -rw-r--r-- | lib/conspire.scm | 8 |
2 files changed, 7 insertions, 12 deletions
@@ -133,8 +133,8 @@ Runs a test with `test-name` that evaluates `(expr ...)`. The test will set (in addition to `call-as-test`): -* `name`: To be the passed `expr` quoted. -* `application`: A list `(expr ...)`, where each is evaluated. +* `form`: To be `(expr ...)`, quoted. +* `name ...`: To be the passed `expr ...` evaluated. * `success?`: If `(expr ...)` evaluates to not false. (with-test-assert test-name body ...) @@ -161,14 +161,7 @@ Tests that |X - Y| <= eps -The test will set (in addition to `call-as-test`): -* `procedure`: to be `%test-approximate` (this is an implementation detail). -* `expected`: to be `X`, quoted. -* `actual`: to be `Y`, quoted. -* `error`: to be `eps`, quoted. -* `application`: The `car` is `%test-approximate`, and the `cdr` is - `expected`, `actual`, and `error,` evaluated. (with-test-error name error-predicate body ...) diff --git a/lib/conspire.scm b/lib/conspire.scm index b02c9ce..7d8bfcd 100644 --- a/lib/conspire.scm +++ b/lib/conspire.scm @@ -327,9 +327,11 @@ (syntax-rules () ((test-application test-name (name expr) ...) (call-as-test test-name (lambda () - (test-set! (quote name) (quote expr)) ... - (let ((name expr) ...) - (test-set! 'application (list name ...)) + (test-set! 'form (quote (expr ...))) + (let ((name (let ((tmp expr)) + (test-set! (quote name) tmp) + tmp)) + ...) (test-set! 'success? (name ...)))))))) (define-syntax test-assert |
