You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: macro-failure diagnostic filter is copy-pasted in two tests #563
Two tests contain the same copy-pasted filter for deciding whether a diagnostic is a macro-handling failure.
A comment asks that the two copies be kept in step, but nothing enforces it.
There should be one copy.
Details
The filter counts a diagnostic when either holds:
it is a project-level CircularDependency or DuplicateMacroName (the macro registry failed to build), or
it is a BadModelName or DuplicateMacroName on a macro model or on the project (two macros or models share a name).
The copies are:
src/simlin-engine/tests/integration/metasd_macros.rs: narrower_macro_attributable_diagnostics, which drives the metasd corpus test and has its own test.
src/simlin-engine/src/macro_expansion_tests.rs, inline in the thyroid-shaped unit test (around line 1497).
They are identical today.
If one changes, the other test weakens and nothing fails.
Fix
Remove the copy from the unit test.
That test already asserts the specific failures it is about: no project-level CircularDependency, and MacroRegistry::build succeeds and resolves both macros.
The real thyroid model goes through the shared filter in metasd_macros.rs.
Alternative: export the filter from the crate behind the test-support feature and call it from both tests.
This keeps both checks, at the cost of a test-only public item.
changed the title [-]engine: macro-attributable Diagnostic classifier is duplicated across a crate compilation boundary (lockstep enforced only by a comment)[/-][+]test: macro-failure diagnostic filter is copy-pasted in two tests[/+]on Oct 12, 2026
Activity
Add Vensim macro (:MACRO:) support (#564)
[-]engine: macro-attributable Diagnostic classifier is duplicated across a crate compilation boundary (lockstep enforced only by a comment)[/-][+]test: macro-failure diagnostic filter is copy-pasted in two tests[/+]