Skip to content

Cover Dict typed getters and Reader resolve helpers#18

Merged
pgundlach merged 1 commit into
mainfrom
claude/accessor-coverage
Jun 23, 2026
Merged

Cover Dict typed getters and Reader resolve helpers#18
pgundlach merged 1 commit into
mainfrom
claude/accessor-coverage

Conversation

@fank

@fank fank commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Covers the public accessor API, which was largely untested.

Tests

  • TestDictAccessors — one fixture exercises Int/Bool/String/Bytes/Name/Array/Dict success values, reference resolution through Dict(), Has/Keys/Len/Iter, and every type-mismatch path (which must report ok=false, not coerce or panic).
  • TestDictNilReceiver — all accessors are safe on a nil *Dict (the common "key absent" result).
  • TestResolveHelpersReader.ResolveInt/ResolveBool/ResolveArray against indirect references, including type-mismatch errors, plus Trailer().
  • TestVersionCatalogOverride — a catalog /Version higher than the header wins.

No production code changed. Coverage: Len/Has/Keys/Bool/Bytes/Trailer/Version → 100%; ResolveInt/Bool/Array 0% → 85.7%.

Deliberately left: Stream-success and RawLength (one-line getters not worth a contrived stream fixture).

Add object_test.go exercising every Dict accessor on one fixture: success
values, reference resolution via Dict(), nil-receiver safety, and the
type-mismatch paths that must report ok=false. Add Reader.ResolveInt/
Bool/Array tests (including mismatch errors), Trailer access, and the
catalog /Version override.

object.go Len/Has/Keys/Bool/Bytes and reader.go Trailer/Version to 100%;
ResolveInt/Bool/Array 0% -> 85.7%.
@fank fank force-pushed the claude/accessor-coverage branch from 4e439a8 to 5ea9d44 Compare June 22, 2026 21:22
@fank fank marked this pull request as ready for review June 22, 2026 22:06
@fank fank requested a review from pgundlach June 22, 2026 22:07
@pgundlach pgundlach merged commit 8a18d87 into main Jun 23, 2026
1 check passed
@pgundlach pgundlach deleted the claude/accessor-coverage branch June 23, 2026 05:24
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