chore: close coverage gaps to 100% (RURL-ptuqbsld)#40
Merged
Conversation
Add targeted tests for the reachable defensive guards and mark the
genuinely unreachable branches # nocov, taking covr to 100%.
- Fix an over-escaped regex literal in the existing scheme-slash NA test
so the stub actually matches the code's pattern (covers parse-phases.R
has_scheme_slashes NA coercion).
- New direct tests for .punycode_to_unicode(""), .host_is_ace() guards,
.cache_enabled() unknown name, and the derive_parse_status() NA
host-has-dot fallback (via a stri_detect_fixed stub).
- Mark the two www-prefix regex-capture else-fallbacks # nocov; the
preceding detection guarantees the capture group always matches.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Closes RURL-ptuqbsld.
covr::package_coverage()was at 99.4% with seven untested error/fallbackbranches. This takes it back to 100%.
What was wrong
The existing
test-rurl-coverage.Rtest "internal parse handles NA regexresults" stubbed
stri_detect_regexto returnNA, but the comparisonliteral was over-escaped (
\\/\\/vs the code's\/\/), soidentical()never matched and the
has_scheme_slashesNA-coercion branch stayeduncovered. Fixed the literal.
Changes
parse-phases.Rscheme-slash NA guard)..punycode_to_unicode("")→"".host_is_ace()NA / empty / non-scalar inputs.cache_enabled()unknown cache namederive_parse_status()NAhost_has_dotfallback (via astri_detect_fixedstub, matching the existing NA-coercion idiom)# nocovon the two genuinely unreachablewww-prefixregex-capture else-fallbacks (the preceding detection guarantees the
(.*)group always matches, so theelseis dead) — with justifyingcomments.
Verification
covr::package_coverage()→ 100%, no uncovered lines.devtools::test()→ all pass.lintrclean on changed files.🤖 Generated with Claude Code