Deterministic visual-semantic SVG comparison with typed reports for programs and text-only agents.
Dependencies
moon add Milky2018/svgdiff@0.10.1///|
test "compare SVG source strings through the public package" {
let before = "<svg width='16' height='16'><rect width='8' height='8' fill='red'/></svg>"
let after = "<svg width='16' height='16'><rect width='8' height='8' fill='blue'/></svg>"
let report = @svgdiff.compare(
before,
after,
@svgdiff.ComparisonProfile::v1_default(),
)
assert_eq(report.schema_version, "5.0")
assert_eq(report.analysis_status, "complete")
assert_eq(report.visual_scene.summary.object_set, "preserved")
assert_eq(report.visual_scene.summary.style, "changed")
assert_true(report.atomic_differences.length() > 0)
assert_true(report.events.length() > 0)
}fn compare(before_svg : String, after_svg : String, profile : ComparisonProfile) -> StructuredReportfn compare_artifact_with_control_and_resources(before_svg : String, after_svg : String, profile : ComparisonProfile, before_resources : ResourceBundle, after_resources : ResourceBundle, control : ComparisonControl) -> ComparisonArtifact raise ComparisonInterruptedfn compare_with_control(before_svg : String, after_svg : String, profile : ComparisonProfile, control : ComparisonControl) -> StructuredReport raise ComparisonInterruptedfn compare_with_control_and_resources(before_svg : String, after_svg : String, profile : ComparisonProfile, before_resources : ResourceBundle, after_resources : ResourceBundle, control : ComparisonControl) -> StructuredReport raise ComparisonInterruptedfn compare_with_resources(before_svg : String, after_svg : String, profile : ComparisonProfile, before_resources : ResourceBundle, after_resources : ResourceBundle) -> StructuredReportfn render_html_report(before_svg : String, after_svg : String, report : StructuredReport, difference_rgba : Bytes?) -> StringInstall
Download zipDeterministic visual-semantic SVG comparison with typed reports for programs and text-only agents.
Dependencies