From: Rasmus Villemoes Date: Tue, 13 May 2025 08:40:27 +0000 (+0200) Subject: test: slre: add more test cases X-Git-Tag: v2025.10-rc1~118^2~67^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09b48305d3b6492553982df75e3a9f99d1f856d0;p=thirdparty%2Fu-boot.git 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 Signed-off-by: Rasmus Villemoes --- diff --git a/test/lib/slre.c b/test/lib/slre.c index 51a50b269aa..b76d33475dd 100644 --- a/test/lib/slre.c +++ b/test/lib/slre.c @@ -15,6 +15,14 @@ static const struct re_test re_test[] = { { "x23", "^\\d+$", 0}, { "banana", "^([bn]a)*$", 1}, { "panama", "^([bn]a)*$", 0}, + { "xby", "^a|b", 1}, + { "xby", "b|^a", 1}, + { "xby", "b|c$", 1}, + { "xby", "c$|b", 1}, + { "", "x*$", 1}, + { "", "^x*$", 1}, + { "yy", "x*$", 1}, + { "yy", "^x*$", 0}, {} };