Skip to content

test: add unit tests for ParseExtToSlice and ParseExcludeToSlice - #300

Merged
pashkov256 merged 3 commits into
pashkov256:mainfrom
Yuki9814:feat/add-unit-tests-for-parse-functions
Mar 17, 2026
Merged

test: add unit tests for ParseExtToSlice and ParseExcludeToSlice#300
pashkov256 merged 3 commits into
pashkov256:mainfrom
Yuki9814:feat/add-unit-tests-for-parse-functions

Conversation

@Yuki9814

Copy link
Copy Markdown
Contributor

Summary

Add table-driven unit tests for the parse functions in internal/utils:

  • ParseExtToSlice: tests for empty string, extensions with/without dot, uppercase/lowercase, spaces handling
  • ParseExcludeToSlice: tests for empty string, single/multiple patterns, spaces handling, empty entries

Changes

  • Added internal/utils/utils_test.go with comprehensive table-driven tests

Related Issue

Closes #279

Yuki9814 added 2 commits March 16, 2026 03:20
Add unit tests for the path package constants to verify
they are non-empty and match expected values:
- AppDirName should be 'deletor'
- RuleFileName should be 'rule.json'
- LogFileName should be 'deletor.log'

This is a good first issue to learn the project layout and run tests.

Closes pashkov256#285
Add table-driven unit tests for the parse functions:
- ParseExtToSlice: tests for empty string, extensions with/without
  dot, uppercase/lowercase, spaces handling
- ParseExcludeToSlice: tests for empty string, single/multiple
  patterns, spaces handling, empty entries

Closes pashkov256#279
@Yuki9814

Copy link
Copy Markdown
Contributor Author

I closed the narrower earlier test PR and kept this one open since it covers the same area plus the ParseExtToSlice / ParseExcludeToSlice cases in a single change.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pashkov256
pashkov256 merged commit 391894f into pashkov256:main Mar 17, 2026
1 check passed
@pashkov256

Copy link
Copy Markdown
Owner

Hi @Yuki9814. Great solution, thanks for contributing to the repository. Would it be difficult for you to put a star on the repository for promotion?

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.

[Good First Issue] Add unit tests for ParseExtToSlice and ParseExcludeToSlice

3 participants