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.
## 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.
Modified benchmark_test.go to dynamically discover all .test files in the
tests directory instead of using hardcoded paths.
Added TestSamplesValidity integration test that validates each test file
against its corresponding .expected file.
Added runSampleWithOutput helper function to capture interpreter output.
Added new test cases with expected outputs for validation.
Renamed benchmark_test.go to lambda_test.go.
Consolidated helper functions to use single runSample function.
Replaced all error handling with assert for consistency.
Removed optional expected file check to require all test files have corresponding expected files.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
This PR enhances the testing infrastructure with dynamic test discovery, automated validation, and improved error handling.
Changes
Testing Infrastructure
TestSamplesValidityintegration test that validates all test files against their expected output.filepath.Globto automatically find all.testfiles.benchmark_test.gotolambda_test.gofor better naming consistency.runSamplefunction.assertfor consistent and clear test output..testfiles to have corresponding.expectedfiles.Iterator Improvements
Swapmethod to iterator for better reduction algorithm.Build System
make testtarget to run tests without benchmarks.Test Cases
church_5^5,church_6^6,fast_list_2^30,list_2^30.Test plan