Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit abfc49a. Configure here.
| } | ||
| } | ||
| return string(b) | ||
| } |
There was a problem hiding this comment.
mangle leaves most characters as null runes
Medium Severity
mangle allocates a zero-valued rune slice and only populates ~25% of the characters with random digits. The remaining ~75% stay as \x00 (null runes), producing strings full of null characters instead of recognizably mangled versions of the input. The else branch that copies the original character from the input string is missing.
Reviewed by Cursor Bugbot for commit abfc49a. Configure here.
| b[i] = r | ||
| } | ||
| return string(b) | ||
| } |
There was a problem hiding this comment.
mixedCase uses byte index for rune slice
Medium Severity
mixedCase allocates its rune slice with len(s) (byte count) but indexes into it using byte positions from range s. For multi-byte characters, byte indices skip values, leaving intermediate positions as \x00 null runes and producing a corrupted output string. This affects any enum names containing non-ASCII characters.
Reviewed by Cursor Bugbot for commit abfc49a. Configure here.


Scope of changes
Implements a test suite for automated testing of generated code.
Estimated PR Size:
Acceptance criteria
This PR will be merged without review.
Author checklist
Note
Low Risk
Changes are limited to tests and a new
TestSuitehelper; no production parsing logic is modified. Main risk is potential flaky tests due to randomized case/space/mangling generation.Overview
Adds a reusable generic
enumify.TestSuiteto automatically validate generated enum code for interface compliance,String()behavior (including bounds/unknown handling), parse coverage across numeric and string forms, and basic DB string-length constraints.Updates the test
Statusenum to include the (previously implied) generated methods for string/JSON/YAML/SQL scan+value behavior, and tweaksParseFactoryinvalid-value test cases to assert negative-number error formatting. Includes a small smoke test (testing_test.go) that runs the new suite againstStatus.Reviewed by Cursor Bugbot for commit abfc49a. Configure here.