creativescala / doodle

Compositional vector graphics in Scala / Scala.JS
https://creativescala.org/doodle/
Apache License 2.0
329 stars 76 forks source link

Add Golden Tests for SVG #92

Open noelwelsh opened 4 years ago

noelwelsh commented 4 years ago

Golden testing is the technique we use for end-to-end testing. The essential idea is to compare output against known good output.

We have golden tests for the Java2D backend, comparing rendered PNGs. We should add tests for the SVG backend. It's not immediately clear how to implement this. We could compare textual output but this is a bit fragile to non-semantic changes. We also cannot easily visualize the output to make sure it's actually correct (or see where it is wrong). Ideally we'd find some Java package that can render SVG to a bitmap.