]> 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, 9 Jun 2025 01:13:07 +0000 (21:13 -0400)
commit133bdc01dc9ee8edae10975db353efc1bdc30576
tree3a534c57200ee5dd4205e18c6e35f435abc87bd4
parent1e4ac0e37714a0d28fd8305cbf8baa06536d0f7d
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]