feat: add comprehensive unit tests for internal/path package#297
Merged
pashkov256 merged 3 commits intopashkov256:mainfrom Apr 4, 2026
Merged
feat: add comprehensive unit tests for internal/path package#297pashkov256 merged 3 commits intopashkov256:mainfrom
pashkov256 merged 3 commits intopashkov256:mainfrom
Conversation
…deToSlice - Add table-driven tests for ParseExtToSlice covering: * Empty strings * Single and multiple extensions * Extensions with/without leading dots * Mixed case handling (uppercase/lowercase) * Whitespace trimming * Duplicate extensions * Special characters and edge cases - Add table-driven tests for ParseExcludeToSlice covering: * Empty strings * Single and multiple patterns * Whitespace variations (leading/trailing/multiple) * Empty items in comma-separated lists * Special patterns and paths - Follow Go testing best practices: * Descriptive test names * Clear test case documentation * Comprehensive edge case coverage * Assertions with helpful error messages Fixes pashkov256#279
- Add tests for AppDirName constant validation - Add tests for RuleFileName constant validation - Add tests for LogFileName constant validation - Verify constants are non-empty - Verify constants match expected values - Add tests for path construction scenarios - Add validation for file extensions - Follow Go testing best practices with descriptive names Fixes pashkov256#285
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Description
This PR adds comprehensive unit tests for the
internal/pathpackage constants, addressing issue #285.🎯 Changes Made
Test Coverage for Path Constants
AppDirName Tests (6 test cases)
RuleFileName Tests (7 test cases)
LogFileName Tests (8 test cases)
Integration Tests (5 test cases)
Immutability Tests (3 test cases)
Summary
🧪 Testing
All tests pass successfully:
Expected Output:
📝 Checklist
gofmt)feat: #285 description🔗 Related Issue
Closes #285
💭 Additional Notes
Why These Tests Matter
Test Design Decisions
Second contribution 🎉
Building on PR #296 to improve test coverage across the codebase!