-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Description
The MDL writer now correctly quotes identifiers containing special characters (like $, /, |) -- fixed in e06c941 ("engine: quote special identifiers in mdl writer") for issue #330. Unit tests in the writer verify the quoting output in isolation, but there is no integration test that writes an identifier with special characters through the MDL writer and then parses it back through the MDL reader to verify the writer/reader contract holds end-to-end.
For example, a variable named $_euro should:
- Be written as
"$ euro" = ...by the MDL writer - Be parsed back as
$_euro(canonical form) by the MDL reader - Produce an identical datamodel round-trip
No existing test in tests/mdl_roundtrip.rs exercises identifiers with $, /, |, or other characters that require quoting.
Why it matters
Without an integration test, a future refactor could break the quoting in the writer or the unquoting in the reader without being caught. The unit tests only verify the writer output format; they do not verify that the reader can consume what the writer produces. This is a correctness confidence gap for the MDL format support.
Components affected
src/simlin-engine/tests/mdl_roundtrip.rs-- test file where the new test should livesrc/simlin-engine/src/mdl/writer.rs-- MDL writer (quoting logic)src/simlin-engine/src/mdl/-- MDL reader/parser (unquoting logic)
Possible approaches
- Add a test case in
tests/mdl_roundtrip.rsthat constructs a model with identifiers containing$,/,|, or other special characters, writes it to MDL via the writer, parses it back via the reader, and asserts the datamodel is equivalent. - Alternatively, add a
.mdltest fixture file with special-character identifiers and include it in the existing roundtrip test suite.
Context
Identified during review of PR #334. The writer fix (e06c941) and its unit tests landed, but the round-trip integration test coverage was noted as a gap.