Add comprehensive unit tests for src/main.rs to reach >80% coverage#57
Closed
Copilot wants to merge 3 commits into
Closed
Add comprehensive unit tests for src/main.rs to reach >80% coverage#57Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Closed
Agent-Logs-Url: https://github.com/MathieuSoysal/CG-Bundler/sessions/4413ff49-4c71-442a-b35e-c4df582e770c Co-authored-by: MathieuSoysal <43273304+MathieuSoysal@users.noreply.github.com>
Owner
|
@copilot It should be clippy compiliant and have good format |
…mma tests Agent-Logs-Url: https://github.com/MathieuSoysal/CG-Bundler/sessions/4413ff49-4c71-442a-b35e-c4df582e770c Co-authored-by: MathieuSoysal <43273304+MathieuSoysal@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add tests to increase code coverage above 80%
Add comprehensive unit tests for src/main.rs to reach >80% coverage
Apr 22, 2026
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.
src/main.rshad only 1 unit test, leaving large portions of the binary's logic uncovered per SonarCloud's new code coverage report.Description
Added 38 new unit tests directly in
src/main.rscovering all previously untested functions and branches.New test coverage
Clistruct methods —get_project_path(default/custom),is_verbose,get_output,is_pretty,is_minify(via both--minifyand--m2),is_aggressive_minify,get_transform_config(all flag combinations:keep_tests,keep_docs,no_expand_modules,minify,m2)minify_code()— empty input, single-line passthrough, multi-line joining, whitespace trimming, empty-line filteringaggressive_minify_code()— escaped string literals, char literals, empty input, trailing comma cleanup before},),]should_rebuild()—Create/Modify/Removeevents on.rsfiles (→ true); non-RS extensions,Access,Other,Anyevents, empty path list (→ false)display_bug_report_info()— smoke test for no panicformat_with_rustfmt()— valid code and syntactically invalid code (returnsNonegracefully)Type of change
Checklist
Screenshots (if applicable)
Additional context
All 39 tests (1 existing + 38 new) pass. Clippy reports no linting issues.