Some instrumented test files have numeric suffixes like _2, _3:
- FibonacciSeriesTest__perfinstrumented_2.java
- KnapsackTest__perfonlyinstrumented_3.java
Updated regex to match optional numeric suffix: (?:_\d+)?
Updated test to verify files with suffixes are detected.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Java instrumented test files (*Test__perfinstrumented.java and
*Test__perfonlyinstrumented.java) were not being cleaned up after
optimization, causing subsequent optimizations to fail.
The find_leftover_instrumented_test_files() method had regex patterns
for Python and JavaScript but was missing Java patterns.
Changes:
- Add Java patterns to cleanup regex in optimizer.py
- Add comprehensive test coverage for Java, Python, JS, and mixed scenarios
- All 4 new tests pass
Testing: Verified regex matches Java instrumented files correctly and
cleanup prevents stale files from blocking optimizations.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>