Skip to content

Cover lexer string/predicate and content-stream array branches#20

Merged
pgundlach merged 2 commits into
mainfrom
claude/cover-lexer-array-branches
Jun 23, 2026
Merged

Cover lexer string/predicate and content-stream array branches#20
pgundlach merged 2 commits into
mainfrom
claude/cover-lexer-array-branches

Conversation

@fank

@fank fank commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Second batch of coverage backfill on logic-bearing helper paths (follows #19).
Characterization tests only — no production code changed.

Covered

  • internal/lex.readLiteralString\r\t\b\f escapes, CR/CRLF line continuations, bare CR/CRLF → LF, unknown escapes, and the trailing-backslash / unterminated error paths (70% → 98%)
  • internal/lex IsDelimiter / hexDigit — spec §7.2.2 character-set classifiers (→ 100%)
  • contentstream.readArray — name/bool/null/nested-array/nested-dict element kinds + unexpected-keyword/unterminated errors (61% → 91%)
  • contentstream.Operand.Int — non-number operand and int64-overflow cases (→ 100%)
  • xref.indexEOL — the no-EOL sentinel (→ 100%)

internal/lex 81.7% → 90.9%, contentstream 75.8% → 82.3%; overall 83.1% → 84.6%. go vet and gofmt clean.

Still deliberately uncovered

Same as #19: the LZW early-change=1 boundary (needs a real qpdf/Ghostscript fixture), examples//main() entry points, and no-logic getters/markers.

- lex readLiteralString: \r\t\b\f escapes, CR/CRLF continuations, bare
  CR->LF, unknown escape, and the trailing-backslash/unterminated errors
- lex IsDelimiter, hexDigit: spec §7.2.2 character-set classifiers
- contentstream readArray: name/bool/null/nested element kinds + errors
- contentstream Operand.Int: non-number and int64-overflow cases
- xref indexEOL: no-EOL sentinel
@fank fank marked this pull request as ready for review June 23, 2026 09:22
@fank fank marked this pull request as draft June 23, 2026 09:24
Keep only comments that explain intent or a footgun a reader can't get from
the test body, git, or the PR; delete or inline the rest.
@fank fank marked this pull request as ready for review June 23, 2026 09:25
@fank fank requested a review from pgundlach June 23, 2026 09:25
@pgundlach pgundlach merged commit 16dd115 into main Jun 23, 2026
1 check passed
@pgundlach pgundlach deleted the claude/cover-lexer-array-branches branch June 23, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants