Skip to content

test(cmd/gf): add unit tests for genenums package#4641

Merged
gqcn merged 1 commit intogogf:masterfrom
lingcoder:test/genenums-unit-tests
Jan 21, 2026
Merged

test(cmd/gf): add unit tests for genenums package#4641
gqcn merged 1 commit intogogf:masterfrom
lingcoder:test/genenums-unit-tests

Conversation

@lingcoder
Copy link
Contributor

Summary

  • Add comprehensive unit tests for the genenums package which handles enum parsing and JSON export
  • 13 new test cases covering core functionality

Test Coverage

Function Tests Description
NewEnumsParser 2 Parser initialization
Export 7 JSON export with various types
ParsePackages 2 Integration with Go packages
EnumItem 1 Data structure
getStandardPackages 1 Standard library detection

Test plan

  • All 13 tests pass locally
  • No modifications to existing code
  • New test file only: genenums_z_unit_test.go

Add comprehensive unit tests for the genenums package which handles
enum parsing and export. The tests cover:

- NewEnumsParser: Parser initialization with/without prefixes
- Export: JSON export with various value types (int, float, bool, string)
- ParsePackages: Integration tests with actual Go packages
- getStandardPackages: Standard library package detection

13 new test cases added.
@gqcn gqcn merged commit 82d4d77 into gogf:master Jan 21, 2026
18 checks passed
@lingcoder lingcoder deleted the test/genenums-unit-tests branch February 28, 2026 00:33
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