Skip to content

Conversation

@yuuki
Copy link
Owner

@yuuki yuuki commented Jun 8, 2025

Summary

  • Consolidate utility functions by moving SetRLimitNoFile and getAddrsFromFile from utils.go into main.go
  • Remove utils.go file to simplify project structure and reduce file count
  • Add comprehensive test coverage for main.go functionality

Test plan

  • All existing tests continue to pass
  • New tests added for main.go utility functions:
    • TestSetRLimitNoFile: Tests file descriptor limit setting with proper state restoration
    • TestValidateClientFlags: Tests flag validation logic for multiple scenarios (valid/invalid combinations)
    • TestGetAddrsFromFile: Tests address file parsing including edge cases (empty files, whitespace, newlines)
    • TestGetAddrsFromFileNotFound: Tests error handling for non-existent files
  • Race detection tests pass (go test -race)
  • Build succeeds without errors
  • Code follows existing patterns and conventions

🤖 Generated with Claude Code

yuuki and others added 2 commits June 8, 2025 20:50
…nsive tests

- Move SetRLimitNoFile and getAddrsFromFile functions from utils.go to main.go
- Remove utils.go file to simplify project structure
- Add main_test.go with comprehensive test coverage:
  - TestSetRLimitNoFile: Tests file descriptor limit setting with proper cleanup
  - TestValidateClientFlags: Tests flag validation logic for various scenarios
  - TestGetAddrsFromFile: Tests address file parsing with edge cases
  - TestGetAddrsFromFileNotFound: Tests error handling for missing files
- All tests pass with race detection enabled

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@yuuki yuuki merged commit 6362ec7 into main Jun 8, 2025
1 check passed
@github-actions github-actions bot mentioned this pull request Jun 8, 2025
@yuuki yuuki deleted the feature/add-main-tests branch June 10, 2025 13:01
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