Add snapshot tests for CircularDependency formatting (#332)#361
Conversation
Pin the user-facing output of `IrGenError::CircularDependency` with insta snapshots, following the localiser-lock pattern established in `src/diagnostic_json_tests.rs`: - `circular_dependency_display` captures the `Display` rendering of the localised message for a deterministic two-target cycle; - `circular_dependency_error_json` captures the JSON diagnostic document produced by `render_error_json` for the same error. The error is constructed through the real pipeline (manifest → `BuildGraph::from_manifest`), and the cycle detector's canonical rotation keeps the reported sequence stable.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Reviewer's GuideAdds snapshot-based regression tests for the user-facing IrGenError::CircularDependency formatting (Display and JSON), using the existing diagnostic_json_tests insta test harness and a deterministic circular manifest built through the real IR pipeline. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary
Closes #332
Adds insta snapshot coverage for the user-facing
IrGenError::CircularDependencymessage, following the establisheddiagnostic_json_testspattern (localiser lock +set_en_localizer+assert_snapshot!).circular_dependency_display— snapshots theDisplayrendering (Circular dependency detected: ["a", "b", "a"].).circular_dependency_error_json— snapshots the JSON diagnostic document viarender_error_json(the plain-error path;IrGenErrordoes not implementmiette::Diagnostic, sorender_diagnostic_jsondoes not apply).The error is produced through the real pipeline (
manifest::from_str→BuildGraph::from_manifest) with a two-target cycle; the detector's canonical rotation keeps the snapshot deterministic.Validation
make check-fmt/make lint/make test— pass (37 suites; both snapshots committed and green)🤖 Generated with Claude Code
Summary by Sourcery
Add snapshot-based regression tests for the CircularDependency IR generation error formatting.
Tests: