diff options
author | Rasmus Villemoes <ravi@prevas.dk> | 2025-05-13 10:40:27 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-05-29 08:25:18 -0600 |
commit | 09b48305d3b6492553982df75e3a9f99d1f856d0 (patch) | |
tree | 11228624f50221b90e76126d0d2f5e2ac7019297 | |
parent | 19b3e24083eb0b1b5299e689d0bc5f1a6c4ebdcd (diff) |
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>
-rw-r--r-- | test/lib/slre.c | 8 |
1 files changed, 8 insertions, 0 deletions
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}, {} }; |