Cover error paths: library coverage past 90%#21
Merged
Conversation
Characterization tests for untrusted-input error handling across the library packages (87.1% -> 90.1% statements); no production code changed. - reader: typed Resolve* type errors, OpenFile failures, rich DocumentInfo fields, Objects iteration, dangling-reference null, xrefFormat - parse: malformed-token error branches (stray/keyword/unterminated/bad key) - filter: /F+/DP abbreviations, malformed and unsupported filter chains - contentstream: inline-image errors, stray delimiters, readDict errors, trailing-operand drop, All early-break, fake-EI scan - crypt: unsupported /V, /V5 via New, Identity stream override - object: typed-getter misses; dump: looksLikeText, xrefFormat
looksLikeText: drop the rule list the named cases already show, keep the non-obvious high-byte magic values. parseObjectFrom: drop the meta parenthetical.
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.
Third coverage batch (follows #19, #20): error-path tests to take the library
packages over 90%. Characterization tests only — no production code changed.
Result
Library coverage (
internal/*+contentstream+ main package) 87.1% → 90.1%.go vet/gofmtclean; all tests pass.Covered (untrusted-input error handling)
Resolve*type mismatches,OpenFilefailures, richDocumentInfofields,Objectsiteration, dangling-reference → null,xrefFormat/F+/DPabbreviations, malformed and unsupported filter chainsreadDicterrors, trailing-operand drop,Allearly-break, fake-EI-in-data scan/V,/V5viaNew, Identity stream overridelooksLikeText,xrefFormatNot chased (by design)
The aggregate
go test ./...number stays ~87.5% —examples/demos and thecmdmain()wrapper are vanity targets (theirrun()logic is already covered). Still deferred: the LZW early-change=1 boundary, which needs a real qpdf/Ghostscript fixture for an independent oracle.