]> gitweb.michael.orlitzky.com - libsvgtiny.git/commit
test/css: add some visually-verified test cases for our new features
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 16 Nov 2023 15:55:11 +0000 (10:55 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 20 Nov 2023 16:42:58 +0000 (11:42 -0500)
commitbf0a5015ded255baf512e96a857947e55cee9728
treebab25ef53d8d525b177ea656d833e39f69c5e6d1
parent099cae0989f0ef3db52de99fb0d1e562465f5a02
test/css: add some visually-verified test cases for our new features

It's helpful to have some test cases for our CSS handling, but
unfortunately, it's not all that easy to write them. How should we
compare the actual output to the expected output?

For now we settle for a visual comparison. You can render the test
diagrams using the example program examples/svgtiny_display_x11, and
also open them in another SVG viewer. Do they look the same? Great.
The test cases should be simple enough that _subtle_ visual mismatches
are not possible.

Automating this is not an impossible problem: for example, we could
render the parsed diagram to a bitmap image using cairo and then
compare it to what we get using librsvg which is also cairo-based. But
that has downsides too (like the portability of librsvg) that we don't
want to address right now.
14 files changed:
test/css/README [new file with mode: 0644]
test/css/attributes.svg [new file with mode: 0644]
test/css/case-sensitive-elements.svg [new file with mode: 0644]
test/css/empty-pseudo-class.svg [new file with mode: 0644]
test/css/id-and-class.svg [new file with mode: 0644]
test/css/inherit.svg [new file with mode: 0644]
test/css/inline.svg [new file with mode: 0644]
test/css/lang.svg [new file with mode: 0644]
test/css/link-pseudo-class.svg [new file with mode: 0644]
test/css/node-name.svg [new file with mode: 0644]
test/css/nth-child.svg [new file with mode: 0644]
test/css/root.svg [new file with mode: 0644]
test/css/siblings-and-descendants.svg [new file with mode: 0644]
test/css/styles-at-end.svg [new file with mode: 0644]