5 Commits

Author SHA1 Message Date
Rasmus Villemoes
de6e54d74d test: slre: add tests for character ranges
The first of these, { "U-Boot", "^[B-Uo-t]*$", 0 }, would match
previously when the - and the letters were all interpreted literally.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-05-29 08:25:18 -06:00
Rasmus Villemoes
4d08883556 test: slre: add test cases for escape char in character class
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-05-29 08:25:18 -06:00
Rasmus Villemoes
ebdd78c487 test: slre: add some (negative) character class tests
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-05-29 08:25:18 -06:00
Rasmus Villemoes
09b48305d3 test: slre: add more test cases
Add some tests for the "drop wrong anchored optimization". Without
the previous commit, the first, fifth and seventh of these would fail,
i.e. those:

	{ "xby", "^a|b", 1},
	{ "", "x*$", 1},
	{ "yy", "x*$", 1},

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-05-29 08:25:18 -06:00
Rasmus Villemoes
ced883d92c test: slre: add tests for regex library
Inspecting the slre.c code reveals a few bugs; those are easy to
demonstrate with the new '=~' test operator. Before fixing them, let's
add a place to add test cases.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-05-29 08:25:18 -06:00