Skip to content

test(push): add fuzz targets for the dimension parsers - #257

Merged
saadqbal merged 1 commit into
developfrom
test/parser-fuzz
Jul 14, 2026
Merged

test(push): add fuzz targets for the dimension parsers#257
saadqbal merged 1 commit into
developfrom
test/parser-fuzz

Conversation

@LukasWodka

@LukasWodkaLukasWodka commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The CLI had zero fuzz targets (coverage audit). This fuzzes the user-facing --target-size / --min-size parsers with two invariants that must hold for ANY input (and the fuzzer proves neither panics):

  • success ⇒ both dimensions strictly positive;
  • error ⇒ both dimensions zero (no partial/garbage pair leaks out).

Seed corpus runs under plain go test; a local -fuzz burst explored 25k+ execs with no failures. No production changes.

🤖 Generated with Claude Code


Note

Low Risk
Test-only addition with no changes to parser or CLI behavior.

Overview
Adds internal/push/parse_fuzz_test.go with fuzz coverage for the CLI --target-size and --min-size parsers (ParseTargetSize, ParseMinSize).

A shared fuzzWxH helper registers a seed corpus (valid WxH/W,H forms plus malformed and edge-case strings) and checks two invariants on arbitrary input: successful parses must yield strictly positive width and height; failed parses must return (0, 0) with no leaked partial values. The same checks also guard against panics. Seeds run under normal go test; go test -fuzz=... can explore further.

No production code changes—test-only.

Reviewed by Cursor Bugbot for commit 5313126. Bugbot is set up for automated code reviews on this repo. Configure here.

The CLI had zero fuzz targets (coverage audit). Fuzz the user-facing
--target-size / --min-size parsers with two invariants that must hold for
ANY input (and the fuzzer proves neither panics):
- success => both dimensions strictly positive;
- error => both dimensions zero (no partial/garbage pair leaks out).
Seed corpus runs under plain `go test`; a 6s local `-fuzz` burst explored
25k+ execs with no failures. No production changes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodka

Copy link
Copy Markdown
ContributorAuthor

bugbot run

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5313126. Configure here.

@LukasWodkaLukasWodka self-assigned this Jul 14, 2026

@saadqbalsaadqbal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 👍 Nice — first fuzz targets in the repo, and the two invariants (success⇒positive dims, error⇒(0,0)) match parseWxH's contract exactly. Good seed corpus (overflow, float, whitespace, half-empty pairs).

@saadqbal
saadqbal merged commit cf00051 into developJul 14, 2026
22 checks passed
@saadqbal
saadqbal deleted the test/parser-fuzz branch July 14, 2026 08:55
Sign up for freeto 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

@LukasWodka@saadqbal