Repository navigation
test: dual-path suites for keyword contract, single-item SQ, and PN accessors - #540
Merged
Merged
Conversation
…ccessors Co-Authored-By: Claude Fable 5 <[email protected]>
|
🎉 This PR is included in version 1.0.0-beta.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Three more issue suites land, now that the reading stack is complete. They cover the naturalized keyword contract (
test/issues/issue3-keyword-contract.test.js, pinning issues #3/#6/#114/#263), single-item sequence handling (issue218-single-item-sq.test.js, #218/#273), and PersonName accessors (issue231-pn-accessors.test.js, #231/#381/#413). All three are green against the branch as it stands — no engine changes ride along.These are what I've been calling dual-path suites: the same behavior gets asserted on both roads to a naturalized dataset. The library now has two — the classic buffered path (
DicomMessage.readFilefollowed byDicomMetaDictionary.naturalizeDataset) and the event-stream path (theNaturalizedListenerfrom the previous PR). These files pin the buffered path, and each one's header cross-references the tests intest/eventStream/NaturalizedListener.test.jsthat pin the identical contract from events, so neither path can drift without a failure.Using #218 as the example: a sequence with exactly one item used to naturalize to a bare object, which broke generic code like
PerFrameFunctionalGroupsSequence[frameNumber - 1]. In 1.0, a single-item sequence stays a length-1 array wrapped in a proxy, so both access styles work — and the suite asserts that with one shared helper:The event-stream twin ("single-item sequence is the item object, with hidden length 1") runs the same assertions on
NaturalizedListeneroutput. The other two suites are just as concrete: keywords come verbatim from the data dictionary, soMappingResourceandMappingResourceUIDno longer collide and the "UID"/"Sequence" suffixes survive; UID values stay UID strings instead of symbolic names; bulk binary like OverlayData stays binary; no null entries get injected into value arrays (the 0.18.11 defect that ballooned small datasets into 300 MB of JSON); and naturalizing the same dict twice no longer throws on PersonName accessors, whose proxy shape also survives a full write and re-read.For the bigger picture: these are three of the fourteen issue suites that exercise both the eager and event-stream paths. Of the remaining dual-path suites, two need the writers, so they'll come with the writer wave. The other eight pin engine fixes that haven't landed yet — character-set integration, meta group length, DS/IS precision, implicit private creators, NUL padding, and fragment handling. Each of those arrives in the same PR as its fix, so the branch stays green the whole way.
🤖 Generated with Claude Code