From 10d5cc19d1a5ed6884969c64d571a2637e7e61aa Mon Sep 17 00:00:00 2001 From: Serhii Yeremenko Date: Wed, 29 Nov 2023 13:26:31 +0200 Subject: [PATCH] Add tests for searching decimal and lengths units Added 2 new tests: test_decimal_size test returns an error code when decimal numbers are detected in width, height, or viewBox attributes. It is impossible to create a pixel-perfect icon if its size does not fit into the pixel grid. test_lengths_units returns an error code when any lengths units are set in width, height, and viewBox attributes. This is protect the icon theme from icons with mm, inch, and others grids. Also, the test ban px units, because the pixel grid is a default units for SVG. A few tests have been renamed, and its description has been updated. --- Makefile | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1229a6ca59c..c3575f17fb4 100644 --- a/Makefile +++ b/Makefile @@ -54,22 +54,38 @@ test: test_short test-all: test_short test_long .PHONY: test_short -test_short: test_renderer test_optimization test_svg_elems test_symlinks test_filenames +test_short: test_rendering_glitches test_optimization test_svg_elems test_symlinks test_filenames test_decimal_size test_lengths_units .PHONY: test_long test_long: test_xml_struct -.PHONY: test_renderer -test_renderer: - # >>> Searching for icons with renderer bugs +.PHONY: test_rendering_glitches +test_rendering_glitches: + # >>> Searching for icons with rendering glitches @! LC_ALL=C grep -E -rl --include='*.svg' \ -e 'd="[a-zA-Z0-9 -.]+-\.[a-zA-Z0-9 -.]+"' \ -e 'd="[a-zA-Z0-9 -.]+\s\.[a-zA-Z0-9 -.]+"' \ $(ICON_THEMES) +.PHONY: test_decimal_size +test_decimal_size: + # >>> Detecting decimal numbers in width/height/viewBox attrs + @! LC_ALL=C grep -E -rl --include='*.svg' \ + -e '>> Detecting lengths units + @! LC_ALL=C grep -E -r --include='*.svg' \ + -e '