Skip to content

Comments

Refactor lspecIO for memory efficiency and add test suite#72

Open
johnchandlerburnham wants to merge 1 commit intomainfrom
jcb/memory
Open

Refactor lspecIO for memory efficiency and add test suite#72
johnchandlerburnham wants to merge 1 commit intomainfrom
jcb/memory

Conversation

@johnchandlerburnham
Copy link
Member

Replace for-loop iteration in lspecIO with tail-recursive helpers (runSuites/runTests) over a plain List, allowing Lean's reference counting to free each TestSeq after it finishes running. Compute map.size before converting to a list so the HashMap can be freed before the long-running test execution begins.

Add a comprehensive test suite (27 tests across 8 suites) runnable via lake test, covering runIO basics, grouping, IO tests, combinators, append, property tests, lspecIO integration, and lspecEachIO. Includes an opt-in memory stress suite (lake test -- memory) that allocates 50 × 100MB to verify RSS stays bounded.

Replace for-loop iteration in lspecIO with tail-recursive helpers
(runSuites/runTests) over a plain List, allowing Lean's reference
counting to free each TestSeq after it finishes running. Compute
map.size before converting to a list so the HashMap can be freed
before the long-running test execution begins.

Add a comprehensive test suite (27 tests across 8 suites) runnable
via `lake test`, covering runIO basics, grouping, IO tests,
combinators, append, property tests, lspecIO integration, and
lspecEachIO. Includes an opt-in memory stress suite
(`lake test -- memory`) that allocates 50 × 100MB to verify RSS
stays bounded.
Copy link
Member

@arthurpaulino arthurpaulino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to run lake test on CI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants