Improve HL7v2 loose parser test coverage #399
Test Results
684 tests +29 684 ✅ +29 2m 2s ⏱️ +48s
110 suites + 1 0 💤 ± 0
110 files + 1 0 ❌ ± 0
Results for commit e353553a. ± Comparison against base commit 776690e0.
[test-results]:data:application/gzip;base64,H4sIAKOUa2oC/13MSw6DIBSF4a0Yxh3wKHjtZhp6gYRUpUEYme69YB9ih/93krMS50e7kEvHGD11ZMk+NWly1MmHuQLnBcqY6qzg/K3rkhH/6e4fhegPnPbjAWyMIX4k5nn/rHG8fMv+uHVzuHX7h2GafCpBrJBCSqERKDWg0ShEAHMztlcDBd47wQXjA3m+ADtBFqAJAQAA
:recycle: This comment has been updated with latest results.
Approved these changes.
suggestion (non-blocking): update comment to describe expected behavior
I thought there was a bug in your test until I found the "MIRTH-1544" code that tests for the string your comment already calls out (^~&|) and then treats it as if the escape character is \ and missing.
Non-blocking comment - Is there an Apache Commons method for this?
Approved these changes.
No. Checked lang3, commons-io and commons-text.
comment (non-blocking): ouch
Apparently the default a long time ago used to be that "parse sub-components" was off. Since the opposite is true now, I understand why this was necessary to fix the test.
But it pains me to look at because, aside from this data strangely including a name mixed with procedure data in OBR-4, I deal with the pain on a regular basis of radiology procedures containing & in the description and not being escaped in the hl7 messages.
Thanks for re-enabling and improving upon some of these old tests.
Would it be possible to rebase and clean up the commit history a bit? My (and AIs) suggestion would be
The goal of the rebase is just to create a clean, atomic history of logical steps, rather than a literal recording of your local trial-and-error.
> An ideal commit history for this PR would look something like this (4 logical commits):
> Fix orphaned HL7v2 test suite and stale fixtures (Squash of your original commits 02 + 03)
> test: cover HL7v2 loose parser encoding and degenerate separators (Squash of your original commits 04 + 05)
> test: cover ER7Serializer.transformWithoutSerializing (Squash of your original commits 06 + 07 + 09)
> test: assert HL7v2 loose parser ER7 round-trip invariant (Your original commit 08)
> This keeps the repository history incredibly readable, preserves your excellent commit messages, and perfectly isolates each area of testing you improved.
Commits 1 and 10 would be dropped.
mgaffigan
NicoPiel
Adds comprehensive unit test coverage and supporting tweaks for the HL7v2 loose serializer/parser:
- transformWithoutSerializing behavior for various delimiter and convertLineBreaks configurations (including the delimiter-replace branch).
- handling of external DTDs and SAX errors.
- encoding character handling, trailing separators, empty segments, and header-only messages.