Improve testing infrastructure with dynamic discovery and validation (#20)
## Summary This PR enhances the testing infrastructure with dynamic test discovery, automated validation, and improved error handling. ## Changes ### Testing Infrastructure - Added `TestSamplesValidity` integration test that validates all test files against their expected output. - Implemented dynamic test discovery using `filepath.Glob` to automatically find all `.test` files. - Renamed `benchmark_test.go` to `lambda_test.go` for better naming consistency. - Consolidated helper functions into a single `runSample` function. - Replaced all error handling with `assert` for consistent and clear test output. - Required all `.test` files to have corresponding `.expected` files. ### Iterator Improvements - Added `Swap` method to iterator for better reduction algorithm. - Improved reduction algorithm with LIFO-based iterator implementation. ### Build System - Added `make test` target to run tests without benchmarks. - Updated Makefile help text to include the new test target. ### Test Cases - Added new test cases with expected outputs: `church_5^5`, `church_6^6`, `fast_list_2^30`, `list_2^30`. - Added validation files for all test cases. ## Test plan - Run tests with expected output validation. - Run benchmarks to ensure performance is maintained. - Verify make targets work correctly. Reviewed-on: #20 Co-authored-by: M.V. Hutz <git@maximhutz.me> Co-committed-by: M.V. Hutz <git@maximhutz.me>
This commit was merged in pull request #20.
This commit is contained in:
8
tests/church_6^6.test
Normal file
8
tests/church_6^6.test
Normal file
@@ -0,0 +1,8 @@
|
||||
0 := \f.\x.x
|
||||
inc n := \f x.(f (n f x))
|
||||
exp n m := (m n)
|
||||
print n := (n F X)
|
||||
|
||||
N := (inc (inc (inc (inc (inc (inc 0))))))
|
||||
|
||||
(print (exp N N))
|
||||
Reference in New Issue
Block a user