test: improve Expat.xs code coverage (93% → 95%)#249
Merged
Conversation
Adds 26 tests (24 run + 2 platform-skipped) exercising previously uncovered code paths in Expat.xs identified via gcov analysis. Key paths covered: - skip_until() suspend/resume for Char, CData, Comment, Proc, Notation, Unparsed, and ExternEnt handlers - UnsetAllHandlers namespace branch via finish() on NS parser - recString append path (multi-attribute start tags) - RecognizedString recstring reset across multiple calls - skip_until early return (index <= st_serial) - ExternalEntityRef with PUBLIC id - pe_implicit DefaultCurrent for PE references - Do_External_Parse string return branch - ExternEnt error path (malformed XML from handler) Moves Expat.xs line coverage from 93.19% to 94.57%. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #249 +/- ##
==========================================
+ Coverage 72.71% 75.73% +3.02%
==========================================
Files 1 1
Lines 1092 1092
Branches 342 342
==========================================
+ Hits 794 827 +33
+ Misses 74 59 -15
+ Partials 224 206 -18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
toddr-bot
added a commit
that referenced
this pull request
Apr 15, 2026
The following test files were added in recent PRs but not included in MANIFEST, meaning they would be absent from the CPAN distribution tarball: - t/coverage_gaps.t (PR #248) - t/expat_xs_coverage.t (PR #249) - t/parser_api.t (PR #244) - t/stream_delimiter.t (PR #243) Also extend MANIFEST.SKIP with standard exclusions for build artifacts (blib/, *.o, *.so, *.bs, *.c), coverage data (cover_db/), and OS files (.DS_Store) to prevent future regenerations from picking up stale files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
What
Adds
t/expat_xs_coverage.twith 26 tests targeting previously uncovered code paths inExpat.xs, identified through gcov analysis.Why
Expat.xs is the core C/XS layer — any regression here is a crash or corruption. Raising line coverage from 93.19% to 94.57% hardens the most critical paths: callback suspend/resume during
skip_until(), namespace cleanup infinish(), and external entity handling edge cases.How
Used
--coveragecompile flags + gcov to identify 74 uncovered lines, then classified them:Testing
make test— 680 tests pass. gcov confirms coverage increase.🤖 Generated with Claude Code
Quality Report
Changes: 1 file changed, 422 insertions(+)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline