Raise unit test coverage to 100% of statements - #3918
Draft
Loyalsoldier with Copilot wants to merge 6 commits into
Draft
Raise unit test coverage to 100% of statements#3918Loyalsoldier with Copilot wants to merge 6 commits into
Loyalsoldier with Copilot wants to merge 6 commits into
Conversation
Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Loyalsoldier
August 5, 2026 14:49
View session
Collaborator
|
@copilot Review this PR, find mistakes and potential bugs, fix them if any. |
Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
Contributor
Author
Fixed the subprocess temp-directory leak in |
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.
Statement coverage went from 43.7% to 100.0% (
main56.4% → 100.0%,cmd/datdump0.0% → 100.0%). Test-only change; no production code touched.internal/dlcholds constants only, so it has no statements to cover.Description
main_test.goTestValidateCharsfor the validator paths unreachable fromparseEntry(empty input).loadData: comments/blank lines, type-less rules, affiliations (&list), inclusion/entry errors, missing file.resolveList: unknown list, list that resolves to zero entries.makeProtoList,loadTasks,writePlainList, andassembleDatacrossall/allowlist/denylist, including missing lists, empty allowlist, write failure, and marshal failure.run()end-to-end (default task and--datprofile) plus its eight error paths;main()success path.cmd/datdump/main_test.go(new)loadGeosite,domain2Builder(all rule types plus an unknown one),exportSite,exportAllwith the generated YAML asserted byte for byte, andrun()for_all_, selected lists, and every failure branch.Notes on approach
main()'sos.Exit(1)branch is exercised by re-executing the test binary behind an env guard; the child's coverage counters are merged via the inheritedGOCOVERDIR.slices.Compact/slices.Sorton allowlist indexes and the reproducibility sort inrun()are all load-bearing:os.Argsare restored viat.Cleanup; the suite is green under-raceand-count=2 -shuffle=on.Worth noting for reviewers: neither workflow runs
go test, so these tests execute locally only unless a CI step is added.