scour/unittests
Niels Thykier 551c88754e
Rewrite colors into shortest possible name
Improve the code for rewriting colors into recognising that some
colors are shorter by name.  This commit enables scour to rewrite
`rgb(255, 0, 0)` into `red` which is slightly shorter than `#f00`
(ditto for `tan` and `pink`).

When the color name ties in length with the hexcode, then scour will
leave it as-is if the input file used a variant of same length
(e.g. `blue`, `cyan` and `aqua` will be left as-is).  But if scour is
rewriting the color code, it will prefer the hex code variant.

Signed-off-by: Niels Thykier <niels@thykier.net>
2021-02-23 19:07:57 +00:00
..
adobe.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
cascading-default-attribute-removal.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
cdata.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
collapse-gradients-gradientUnits.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
collapse-gradients-preserve-xlink-href.svg Add test case for #198/#202 2020-05-17 16:29:08 +02:00
collapse-gradients.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
collapse-same-path-points.svg Fix a unittest that failed due to the increased accuracy of paths after 29e005bf7b 2016-08-31 06:32:05 +02:00
collapse-straight-path-segments.svg Improve and fix behaviour when collapsing straight paths segments (#146) 2017-05-18 00:53:25 +02:00
color-formats.svg Rewrite colors into shortest possible name 2021-02-23 19:07:57 +00:00
comment-beside-xml-decl.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
comments.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
commonized-referenced-elements.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
css-reference.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
descriptive-elements-with-text.svg Add options to remove descriptive elements (#102) 2016-08-29 21:05:12 +02:00
doctype.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
dont-collapse-gradients.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
dont-convert-short-color-names.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
duplicate-gradient-stops-pct.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
duplicate-gradient-stops.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
duplicate-gradients-update-style.svg Fix replacement of duplicate gradients if "fill/stroke" contains fallbacks (#109) 2016-09-05 22:44:55 +02:00
empty-descriptive-elements.svg Add options to remove descriptive elements (#102) 2016-08-29 21:05:12 +02:00
empty-g.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
empty-style.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
encoding-iso-8859-15.svg Unittests: Add a test for proper decoding of ISO 8859-15 2015-12-09 21:32:18 +01:00
encoding-utf8.svg Unittests: Add a test for proper decoding of ISO 8859-15 2015-12-09 21:32:18 +01:00
entities.svg tests: Add unit tests for the escaping of quote characters in attribute values 2017-09-03 18:07:27 +02:00
fill-none.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
flowtext-less.svg add option to check and warn or bail out on flowtext 2016-04-02 16:49:10 +02:00
flowtext.svg add option to check and warn or bail out on flowtext 2016-04-02 16:49:10 +02:00
font-styles.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
full-descriptive-elements.svg Add options to remove descriptive elements (#102) 2016-08-29 21:05:12 +02:00
gradient-default-attrs.svg Add unittests for #66 2016-08-26 23:45:44 +02:00
group-creation.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
group-no-creation-tspan.svg Only attempt to group elements that the content model allows to be children of a <g> when --create-groups is specified. (#98) 2016-08-29 02:33:13 +02:00
group-no-creation.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
group-sibling-merge-crash.svg scour: Fix another variant of the crash from #260 (#264) 2020-11-22 15:00:43 +01:00
group-sibling-merge.svg scour: Fix another variant of the crash from #260 (#264) 2020-11-22 15:00:43 +01:00
groups-in-switch-with-id.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
groups-in-switch.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
groups-with-title-desc.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
ids-protect.svg Add unittests for --protect-ids-_ options 2016-09-18 18:29:13 +02:00
ids-to-strip.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
ids.svg Allow elements to be found via Document.getElementById() in the minidom document returned by scourXmlFile() (#68) 2016-08-25 21:13:09 +02:00
important-groups-in-defs.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
inkscape.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
minimal.svg Add unittests which emulate calling the scour module from command line 2016-09-18 17:13:00 +02:00
move-common-attributes-to-grandparent.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
move-common-attributes-to-parent.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
nested-defs.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
nested-useless-groups.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
newlines.svg Add unittests for whitespace handling in text node 2018-07-03 22:53:05 +02:00
no-collapse-lines.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
orient-marker.svg Fix improper comparison of numeric default attribute values with textvalues resulting in wrongly removed attributes (#101) 2016-08-29 06:37:28 +02:00
overflow-marker.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
overflow-svg.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
path-abs-to-rel.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
path-bez-optimize.svg Fix conversion of cubic Bézier "curveto" commands into "shorthand/smooth curveto" commands. (#110) 2016-09-06 01:43:36 +02:00
path-command-rewrites.svg Implement a basic rewrite of redundant commands 2018-03-11 08:33:50 +00:00
path-elliptical-flags.svg Fix handling of boolean flags in elliptical path commands (#183) 2018-04-08 15:32:47 +02:00
path-implicit-line.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
path-line-optimize.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
path-no-optimize.svg Add a check to prevent we make path data longer by "optimization" 2016-08-31 07:06:42 +02:00
path-precision-control-points.svg Add unittest for --set-c-precision (7cb0d36d72) 2017-02-25 19:44:18 +01:00
path-precision.svg Improve and fix behaviour when collapsing straight paths segments (#146) 2017-05-18 00:53:25 +02:00
path-quad-optimize.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
path-simple-triangle.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
path-sn.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
path-truncate-zeros-calc.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
path-truncate-zeros.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
path-use-scientific-notation.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
path-with-caps.svg Improve and fix behaviour when collapsing straight paths segments (#146) 2017-05-18 00:53:25 +02:00
path-with-closepath.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
polygon-coord-neg-first.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
polygon-coord-neg.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
polygon-coord.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
polygon.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
polyline-coord-neg-first.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
polyline-coord-neg.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
polyline-coord.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
protection.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
quot-in-url.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
quotes-in-styles.svg tests: Add unit tests for preservation of quotes in CSS styles 2017-09-03 18:07:27 +02:00
raster-formats.svg Add unittests for embedding rasters (and --disable-embed-rasters) 2016-09-23 23:14:56 +02:00
raster-paths-local.svg Exclude (system specific) absolute paths from test file and add a unittest that creates/tests absolute paths on-the-fly 2016-09-23 23:16:19 +02:00
raster-paths-remote.svg Add unittests for embedding rasters (and --disable-embed-rasters) 2016-09-23 23:14:56 +02:00
raster.gif Add three images (for usage with a future unittest) 2016-09-18 22:41:24 +02:00
raster.jpg Add three images (for usage with a future unittest) 2016-09-18 22:41:24 +02:00
raster.png Add three images (for usage with a future unittest) 2016-09-18 22:41:24 +02:00
redundant-svg-namespace.svg remapNamespacePrefix: Preserve prefix of attribute names (#255) 2020-06-10 20:18:21 +02:00
referenced-elements-1.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
referenced-font.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
refs-in-defs.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
remove-default-attr-order.svg test: Use number-optional-number variant of kernelUnitLength 2018-04-21 06:19:38 +00:00
remove-default-attr-std-deviation.svg Avoid crashing on stdDeviation attribute 2018-04-21 06:39:08 +00:00
remove-duplicate-gradients-master-without-id.svg Add test case for #203 2020-05-17 16:13:45 +02:00
remove-duplicate-gradients.svg Fix replacement of duplicate gradients if "fill/stroke" contains fallbacks (#109) 2016-09-05 22:44:55 +02:00
remove-unused-attributes-on-parent.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
scour-lengths.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
shorten-ids-stable-output.svg shortenID: Improve tracking of optimal ID lengths 2018-04-16 18:52:12 +00:00
shorten-ids.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
sodipodi.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
straight-curve.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
stroke-none.svg Add unittests for 1cde426009 and 641d2db08a392e4a7df20c700e1accb9cd8d1341 2016-09-11 00:16:17 +02:00
stroke-nowidth.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
stroke-transparent.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
style-cdata.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
style-to-attr.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
style.svg Throw some line breaks in there... 2016-09-11 14:03:31 +02:00
transform-matrix-is-identity.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-matrix-is-rotate-45.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-matrix-is-rotate-90.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-matrix-is-rotate-135.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-matrix-is-rotate-225.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-matrix-is-rotate-neg-45.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-matrix-is-rotate-neg-90.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-matrix-is-scale-2-3.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-matrix-is-scale-neg-1.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-matrix-is-translate.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-rotate-fold-3args.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-rotate-is-identity.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-rotate-trim-range-719.5.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-rotate-trim-range-neg-540.0.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-scale-is-identity.svg Avoid crashing on "scale(1)" (short for "scale(1, 1)") 2018-04-18 05:41:35 +00:00
transform-skewX-is-identity.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-skewY-is-identity.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
transform-translate-is-identity.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
unreferenced-defs.svg Don't remove unreferenced defs if --keep-unreferenced-defs is specified (#62) 2016-08-14 18:52:55 +02:00
unreferenced-font.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
unreferenced-linearGradient.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
unreferenced-pattern.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
unreferenced-radialGradient.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
useless-defs.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
viewbox-create.svg Unittests for --enable-viewboxing 2017-02-19 16:10:01 +01:00
viewbox-remove.svg Unittests for --enable-viewboxing 2017-02-19 16:10:01 +01:00
whitespace-defs.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
whitespace.svg Add unittests for whitespace handling in text node 2018-07-03 22:53:05 +02:00
xml-namespace-attrs.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
xml-ns-decl.svg Restore unittests from history 2015-12-06 19:59:06 +01:00
xml-space.svg Add unittest for --strip-xml-space 2016-09-18 17:13:00 +02:00
xml-well-formed.svg Unittests: Account for b979fe19e5 (fix one test and add two more) 2015-12-07 00:33:08 +01:00