1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

expr: Fix error message for large numbers as range index

This commit is contained in:
Teemu Pätsi 2025-05-27 16:45:54 +03:00
parent 74ad163da9
commit 4946922c0f
No known key found for this signature in database
2 changed files with 26 additions and 15 deletions

View file

@ -472,6 +472,26 @@ fn test_regex_range_quantifier() {
.args(&["ab", ":", "ab\\{\\}"])
.fails()
.stderr_only("expr: Invalid content of \\{\\}\n");
new_ucmd!()
.args(&["_", ":", "a\\{12345678901234567890\\}"])
.fails()
.stderr_only("expr: Regular expression too big\n");
new_ucmd!()
.args(&["_", ":", "a\\{12345678901234567890,\\}"])
.fails()
.stderr_only("expr: Regular expression too big\n");
new_ucmd!()
.args(&["_", ":", "a\\{,12345678901234567890\\}"])
.fails()
.stderr_only("expr: Regular expression too big\n");
new_ucmd!()
.args(&["_", ":", "a\\{1,12345678901234567890\\}"])
.fails()
.stderr_only("expr: Regular expression too big\n");
new_ucmd!()
.args(&["_", ":", "a\\{1,1234567890abcdef\\}"])
.fails()
.stderr_only("expr: Invalid content of \\{\\}\n");
}
#[test]