Automated test suite for Wile's Scheme implementation using the (chibi test) framework.
test/
├── scheme/ # Core language tests
│ # - Numeric tower, hygiene, continuations, etc.
├── regression/ # Bug regression tests (not yet populated)
│ # - issue-XXX-*.scm for specific bug fixes
├── run-all.scm # Scheme test runner (discovers and executes tests)
├── run-all.sh # Shell wrapper for test execution
├── scheme_test.go # Go integration test (runs Scheme suite via Go test)
└── README.md # This file
Library-specific tests are colocated with their implementations (pattern, not yet populated):
lib/
└── srfi/1/
├── fold.scm
└── test/
└── fold-test.scm
Via Make (recommended):
make test # Run all tests (Go + Scheme)
make test-scheme # Run only Scheme testsTesting against different Scheme implementations:
# Test with Wile (default)
make test-scheme
# Test with Chez Scheme
make test-scheme SCHEME=chez-scheme
# Test with an older Wile version
make test-scheme SCHEME=./old-dist/wile
# Test with Chibi-Scheme
make test-scheme SCHEME=chibi-scheme
# Test with any other R7RS Scheme
make test-scheme SCHEME=/path/to/wileDirectly via shell:
./test/run-all.sh # Use default binary
SCHEME=chez-scheme ./test/run-all.sh # Override binaryVia Scheme interpreter:
./dist/wile -f test/run-all.scmVia Go test:
go test ./test # Runs TestSchemeTestSuiteAll test files must match the pattern *-test.scm for automatic discovery.
| Location | Pattern | Example |
|---|---|---|
| Library tests | stdlib/lib/<library>/test/<module>-test.scm |
stdlib/lib/srfi/1/test/fold-test.scm |
| Core tests | test/scheme/<feature>-test.scm |
test/scheme/numeric-tower-test.scm |
| Regression tests | test/regression/issue-<num>-<slug>.scm |
test/regression/issue-123-macro-hygiene.scm |
;;; <module>-test.scm - Unit tests for <module>
;;;
;;; Tests the <module> implementation for correctness and edge cases.
(import (scheme base)
(chibi test)
;; Import module under test
(srfi 1))
(test-begin "<module>")
(test-group "basic operations"
(test '(1 2 3) (append '(1) '(2 3)))
(test '() (append '() '())))
(test-group "edge cases"
(test-error (car '()))
(test-assert (null? '())))
(test-group "regression"
;; Issue #123: append should preserve exact list structure
(test '(a b c) (append '(a) '(b c))))
(test-end)The (chibi test) framework provides:
| Macro | Purpose | Example |
|---|---|---|
test |
Basic equality test | (test expected-value expression) |
test-assert |
Boolean assertion | (test-assert (> 5 3)) |
test-error |
Expect an error | (test-error (car '())) |
test-group |
Group related tests | (test-group "arithmetic" ...) |
test-equal |
Custom comparator | (test-equal my-equal? expected expr) |
The run-all.sh script discovers all test files by searching for *-test.scm in:
test/directory (recursive)lib/directory (recursive)
Tests are executed in lexicographic order by file path.
Scheme tests run as part of make test in CI. The Go test TestSchemeTestSuite in scheme_test.go executes the full Scheme test suite and fails the build if any tests fail.
- For library code: Create
lib/<library>/test/<module>-test.scm - For core features: Create
test/scheme/<feature>-test.scm - For bug fixes: Create
test/regression/issue-<num>-<slug>.scm - Run tests:
make testor./test/run-all.sh
Tests are automatically discovered—no need to register them in a central list.
The test suite can run against any R7RS Scheme implementation:
# Compare multiple implementations
./test/compare-schemes.sh ./dist/darwin/arm64/wile chez-scheme chibi-scheme
# Compare Wile versions
cp ./dist/darwin/arm64/wile ./dist/darwin/arm64/wile-old
make build
./test/compare-schemes.sh ./dist/darwin/arm64/wile-old ./dist/darwin/arm64/wileSee test/COMPATIBILITY.md for detailed guidance on cross-implementation testing.
test/COMPATIBILITY.md— Cross-implementation testing guideCONTRIBUTING.md— Full test guidelines and conventionslib/chibi/test.scm— Test framework implementation