Repository navigation
test: pin private tag handling, undefined value writes, and element ordering - #527
Merged
Merged
Conversation
…rdering 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.
This batch of the regression bank pins three areas of writer and naturalizer behavior that already work on this branch, and files the parts that don't as
it.skipentries named after their issues. The suites land green; the skips are the record of what the later fix PRs need to flip.test/issues/issue365-tag-order.test.jscovers two writer basics. For #365: after editing a naturalized dataset — adding keywords whose tags sort before ones already present — the written output must still emit top-level tags in strictly ascending order (upstream, dciodvfy flagged "Tags out of order" on a written SEG). The assertion walks the raw output bytes with the independent walker intest/issues/part10Walker.jsrather than trusting the library's own reader. For #196: upserting much longer values (the issue's PatientName pattern) must grow the write buffer instead of throwing "Request more than currently allocated buffer". Both are green, no skips.test/issues/issue388-private-tags.test.jscovers private tags — vendor-specific elements that aren't in the standard dictionary — going through naturalize and denaturalize. In 0.19.x, a sequence item holding private tags got their numeric-string keys defined on the sequence array itself, which extended the array to millions of undefined entries and crashed denaturalization (#388). The 1.0 Proxy-based accessors keep those keys on the item, which this test pins:For #215, the supported custom-dictionary path is pinned green:
new DicomMetaDictionary(customDictionary).denaturalizeDataset(ds)preserves private elements whose naturalized key matches a custom entry's name. Three KNOWN GAPs are skipped in this file: static denaturalize drops private elements inside sequence items (#388), static denaturalize drops unregistered top-level private tags entirely (#215), andregisterTag()is asymmetric — registered names naturalize but never denaturalize, because the lazy name map is built only from the standard dictionary (#215 again).test/issues/issue417-undefined-values.test.jscovers elements whose Value is[undefined], a shape real reads have produced (the issue saw it on Pregnancy Status). Todaywrite()dies deep in the buffer layer with a bare "Not a number: undefined" and no hint of which tag caused it. The desired contract — skip the element or fail with an error that names the tag — is the skipped KNOWN GAP #417. A companion green test pins today's observed failure mode through the reporter's exactwrite({ allowInvalidVRLength: true })call, so the fix flips both together. The naturalized side is pinned green: a field explicitly set toundefinedis omitted by denaturalize, and the subsequent write and re-read succeed.🤖 Generated with Claude Code