git.openpandora.org
/
pandora-u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe4f211
)
test: slre: add tests for character ranges
author
Rasmus Villemoes
<ravi@prevas.dk>
Tue, 13 May 2025 08:40:33 +0000
(10:40 +0200)
committer
Tom Rini
<trini@konsulko.com>
Thu, 29 May 2025 14:25:18 +0000
(08:25 -0600)
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>
test/lib/slre.c
patch
|
blob
|
history
diff --git
a/test/lib/slre.c
b/test/lib/slre.c
index
053d046
..
ff2386d
100644
(file)
--- a/
test/lib/slre.c
+++ b/
test/lib/slre.c
@@
-29,6
+29,14
@@
static const struct re_test re_test[] = {
/* DIGIT is 17 */
{ "##\x11%%\x11", "^[#%\\d]*$", 0 },
{ "##23%%45", "^[#%\\d]*$", 1 },
+ { "U-Boot", "^[B-Uo-t]*$", 0 },
+ { "U-Boot", "^[A-Zm-v-]*$", 1 },
+ { "U-Boot", "^[-A-Za-z]*$", 1 },
+ /* The range --C covers both - and B. */
+ { "U-Boot", "^[--CUot]*$", 1 },
+ { "U-Boot", "^[^0-9]*$", 1 },
+ { "U-Boot", "^[^0-9<->]*$", 1 },
+ { "U-Boot", "^[^0-9<\\->]*$", 0 },
{}
};