W-23530974: Normalize CRLF in TCK JSON string comparison#136
Merged
Conversation
The TCK lane failed on the Windows CI runner: a JSON output embedding a CSV value is written with CRLF line endings on Windows but the fixture uses LF, so the escaped \r\n vs \n inside the JSON string value made compareJson report a mismatch. macOS/Linux (LF) never hit it. Normalize CRLF -> LF within JSON string values during comparison (deepEqual gains a normEol flag used by the JSON path), matching the CLI's AssertionHelper EOL handling. XML text nodes are already normalized by fast-xml-parser, and csv/txt/etc. already EOL-normalize, so the fix is scoped to the JSON path. - compare.ts: deepEqual(a, b, normEol=false); compareJson passes normEol=true. - 2 unit tests: CRLF-vs-LF inside a string value matches; genuinely different string values still differ. TCK lane: 660 pass / 57 skip unchanged locally. Unit lane: 121. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
andres-rad
approved these changes
Jul 22, 2026
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.
What
Fixes the Windows-only TCK lane failure introduced in #135 (run).
A conformance case outputs JSON with an embedded CSV string value. DataWeave's CSV writer emits CRLF on Windows but LF elsewhere, so the escaped
\r\nvs\ninside the JSON string value madecompareJsonreport a mismatch. macOS/Linux (LF) never hit it.Fix
Normalize CRLF → LF within JSON string values during comparison (
deepEqualgains anormEolflag, used by the JSON path), matching the CLI'sAssertionHelperEOL handling.Scoped to the JSON path only — XML text nodes are already normalized by
fast-xml-parser, and csv/txt/etc. already EOL-normalize.Testing
npm run test:unit→ 121 passed (+2: CRLF-in-string matches; different strings still differ)npm run test:tck→ 660 passed, 57 skipped, 0 failures (unchanged on macOS)tsc --noEmitclean🤖 Generated with Claude Code