Repository navigation
test: pin round-trip integrity, UUID-derived UIDs, and UN padding behavior - #525
Merged
Merged
Conversation
…avior 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 is the second batch of the regression bank for the 1.0 branch: test suites that pin behavior the current code already gets right, with the known-broken parts checked in as
it.skipentries that name the issue they're waiting on. The suites arrive green, and later engine work flips the skips one issue at a time instead of rediscovering old bugs.Three suites here, all derived from upstream issue reports, all running on synthetic in-memory files (no fixtures needed).
test/issues/issue111-roundtrip-integrity.test.jsis the big one. It pins the read → naturalize → denaturalize → write → read round trip on synthetic multiframe files, in both plain and encapsulated (fragment-list) variants. "Naturalize" is the conversion from the raw tag dictionary to the friendly keyword-named JavaScript object, and denaturalize is the way back. Six upstream reports live in this suite: #111 (the round trip produced a broken image), #115 (PixelRepresentation with value 0 — a falsy number — was dropped), #95 (a same-length PatientName edit corrupted the pixel bytes), #167 (repeated read/write cycles grew the file without bound until it ran out of memory), #418 (a zero-length element was silently omitted, changing the element set), and #458/#466 (a lenient write option silently lost pixel data, and the output made DCMTK error out downstream).Here's the #167 pin, representative of the style:
test/issues/issue61-uuid-uids.test.jscovers UID generation. The standard says a UID rooted at "2.25" must be the decimal encoding of a 128-bit UUID. The current generator just concatenates 39 random digits, and that integer is usually too large to correspond to any UUID at all. The green tests pin the syntax the generator does satisfy: starts with "2.25.", 64 characters max, digits only, no leading zero. The UUID-derivation requirement itself is the suite'sit.skip, labeled KNOWN GAP #61.test/issues/issue52-un-padding.test.jssettles an old padding question. UN is the "unknown" value representation, and DICOM requires every value to occupy an even number of bytes, so odd-length values get one pad byte. The #52 reporter read the 2013 standard as forbidding a NUL pad for UN, but the current edition explicitly pads UN with a trailing NUL byte, like OB. So this suite pins NUL-padding to an even declared length as the deliberate, standard-conformant contract — no skips here.Merging this only adds tests. Everything unskipped passes on this branch as-is, and the one skipped gap (#61) stays on the record with its issue number until the engine-fix PR flips it.
🤖 Generated with Claude Code