diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2024-01-21 19:20:22 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2024-01-21 19:20:22 +0200 |
| commit | b5ddfdc53cf1cf2197adf8718ea405acfa2fe6f7 (patch) | |
| tree | 8148ddcd0ea648a669a1863f48c91b9298071daa /utils.scm | |
| parent | 351829f43fef1ef758defdb22316b6a0d848e530 (diff) | |
Refactor
Diffstat (limited to 'utils.scm')
| -rw-r--r-- | utils.scm | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -1,14 +1,15 @@ -(module utils (inline-tests) - (import scheme - (chicken base) - (chicken process-context)) +(module utils (*should-run-inline-tests?* inline-tests) + (import (scheme) + (chicken process-context)) - (define-syntax inline-tests - (syntax-rules () - ((_ expr ...) - (let* ((v (get-environment-variable "INLINE_TESTS")) - (should-run-inline-tests? (and (string? v) - (string=? v "1")))) - (if should-run-inline-tests? - (begin expr ...))))))) + (define *should-run-inline-tests?* + (let ((v (get-environment-variable "INLINE_TESTS"))) + (and (string? v) + (string=? v "1")))) + + (define-syntax inline-tests + (syntax-rules () + ((_ expr ...) + (if *should-run-inline-tests?* + (begin expr ...)))))) |
