Skip to content

Add MDL round-trip integration test for special-character identifiers #335

@bpowers

Description

@bpowers

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:

  1. Be written as "$ euro" = ... by the MDL writer
  2. Be parsed back as $_euro (canonical form) by the MDL reader
  3. 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 live
  • src/simlin-engine/src/mdl/writer.rs -- MDL writer (quoting logic)
  • src/simlin-engine/src/mdl/ -- MDL reader/parser (unquoting logic)

Possible approaches

  1. Add a test case in tests/mdl_roundtrip.rs that 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.
  2. Alternatively, add a .mdl test 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions