Skip to content

test: cover CLI paths and string-length boundary; clarify cls comment#89

Merged
henryiii merged 2 commits into
mainfrom
test/cli-coverage-and-cls-comment
Jun 15, 2026
Merged

test: cover CLI paths and string-length boundary; clarify cls comment#89
henryiii merged 2 commits into
mainfrom
test/cli-coverage-and-cls-comment

Conversation

@henryiii

Copy link
Copy Markdown
Owner

🤖 AI text below 🤖

Closes item 3 and the Minor note of #86.

Tests

  • run_on_file was entirely untested. Added coverage for: error reporting to stdout, the max_string_length argument, and the SyntaxError branch (asserts SystemExit(1) and the Traceback: output).
  • Added a test for main() (argv parsing -> reporting).
  • Added a max_string_length boundary test confirming len == max is flagged (the check is >=).
  • These mutate the class-level max_string_length option, so a fixture restores it — addressing the test-ordering fragility called out in CLAUDE.md.

Minor

  • Flake8ASTErrorInfo.cls was annotated # unused, but it is the 4th tuple element flake8 expects. Comment corrected.

Pure test/comment changes — no behavior change. 14 tests pass; lint/mypy clean.

henryiii added 2 commits June 15, 2026 19:19
- Add tests for run_on_file (reporting, max_string_length, SyntaxError
  branch) and main(), which were previously untested.
- Add a max_string_length boundary test (len == max is flagged).
- Use a fixture to restore the class-level option these tests mutate.
- Fix the misleading "# unused" comment on Flake8ASTErrorInfo.cls; it is
  the 4th tuple element flake8 expects.

Refs #86

Assisted-by: ClaudeCode:claude-opus-4.8
Fold the pre-existing test that mutated the class-level option into the
restoring fixture, so it no longer leaks state to later tests.

Assisted-by: ClaudeCode:claude-opus-4.8
@henryiii henryiii force-pushed the test/cli-coverage-and-cls-comment branch from c0690f1 to 1815be0 Compare June 15, 2026 23:19
@henryiii henryiii merged commit 6b83780 into main Jun 15, 2026
12 checks passed
@henryiii henryiii deleted the test/cli-coverage-and-cls-comment branch June 15, 2026 23:28
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.

1 participant