aboutsummaryrefslogtreecommitdiffstats
path: root/tests/impl.scm
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2025-08-05 18:20:28 -0400
committerGravatar Peter McGoron 2025-08-05 18:20:28 -0400
commitf36f61cb4ab68285b2ba4a230f312843e4faf885 (patch)
tree32fd2958c18c54c875171bf177217b2d44dd06cf /tests/impl.scm
parentadd adjustable value rewriter (diff)
Support Foment
Foment had some peculiarities: 1. Parameterize objects are initialized with the objects themselves at some point, which broke the previous code. 2. Foment cannot discard multiple value returns in some scenarios.
Diffstat (limited to 'tests/impl.scm')
-rw-r--r--tests/impl.scm45
1 files changed, 22 insertions, 23 deletions
diff --git a/tests/impl.scm b/tests/impl.scm
index bae066a..a25fa10 100644
--- a/tests/impl.scm
+++ b/tests/impl.scm
@@ -98,39 +98,39 @@
'before-test! dummy
'setup-test! dummy
'when-test-skipped dummy
- 'after-test dummy
+ 'after-test values
'report-test dummy
'on-exception dummy
'setup-group! dummy
'before-group! dummy
- 'after-group dummy
+ 'after-group values
'report-group dummy)))))
(test-group "call-as-test, dummy dict"
(test-group "before test"
- (with-test-assert "before-test skips tests when returning #f"
+ (with-test-assert "skip-test? skips tests when returning #f"
(parameterize ((test-info
(list 'replace
(dict-set! dummy-dto dummy-dict
- 'before-test!
- (lambda (name) #f)))))
+ 'skip-test?
+ (lambda (name) #t)))))
(let ((called? #f))
(call-as-test "name" (lambda () (set! called? #t)))
- (not called?)))
- (with-test-assert "before-test gets the test name"
- (define inside-test-info
- (dict-set! dummy-dto dummy-dict
- 'before-test!
- (lambda (name)
- (unless (equal? name "1234")
- (raise "exception"))
- #t)))
- (parameterize ((test-info
+ (not called?))))
+ (with-test-assert "before-test gets the test name"
+ (define inside-test-info
+ (dict-set! dummy-dto dummy-dict
+ 'before-test!
+ (lambda (name)
+ (unless (equal? name "1234")
+ (raise "exception"))
+ #t)))
+ (parameterize ((test-info
(list 'replace inside-test-info)))
- (let ((called? #f))
- (call-as-test "1234"
- (lambda () (set! called? #t)))
- called?)))))
+ (let ((called? #f))
+ (call-as-test "1234"
+ (lambda () (set! called? #t)))
+ called?))))
(test-group "after test"
(let ((called? #f)
(pair (cons #f #f)))
@@ -289,7 +289,7 @@
(test-eqv "test number" 1 (dict-ref outer-dto outer-dict 'tests))))
(test-group "call-as-group"
- (with-test-assert "group with no tests"
+ (test-group "group with no tests"
(define-values (dto dict)
(parameterize ((test-info (list 'replace default-test-info-dto silent-dict)))
(call-as-group #f (lambda () #f))
@@ -298,7 +298,7 @@
(test-eqv "tests number" 0 (dict-ref dto dict 'tests))
(test-eqv "failed number" 0 (dict-ref dto dict 'failed))
(test-eqv "skipped number" 0 (dict-ref dto dict 'skipped)))
- (with-test-assert "group with 1 test"
+ (test-group "group with 1 test"
(define-values (dto dict)
(parameterize ((test-info (list 'replace default-test-info-dto silent-dict)))
(test-group #f (with-test-assert #f #t))
@@ -321,13 +321,12 @@
(call-as-test #f (lambda ()
(test-set! 'success? #f)))))
(inspect-test-info values)))
- ;; TODO: fix failing
(begin
(test-eqv "passed number" 2 (dict-ref dto dict 'passed))
(test-eqv "tests number" 4 (dict-ref dto dict 'tests))
(test-eqv "failed number" 1 (dict-ref dto dict 'failed))
(test-eqv "skipped number" 1 (dict-ref dto dict 'skipped))))
- (with-test-assert "nested groups"
+ (test-group "nested groups"
(define inner-dict #f)
(define inner-dto #f)
(define-values (dto dict)