mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Refuse to translate if set2 contains more than one unique characters and set1 contains a character class (#6472)
* Refuse to translate if set2 contains > 1 unique characters
This commit is contained in:
parent
7766257aee
commit
0ae6d43536
2 changed files with 39 additions and 1 deletions
|
@ -1386,3 +1386,23 @@ fn check_set1_longer_set2_ends_in_class_with_trunc() {
|
|||
.args(&["-t", "[:lower:]a", "[:upper:]"])
|
||||
.succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_complement_2_unique_in_set2() {
|
||||
let x226 = "x".repeat(226);
|
||||
|
||||
// [y*] is expanded tp "y" here
|
||||
let arg = x226 + "[y*]xxx";
|
||||
new_ucmd!().args(&["-c", "[:upper:]", arg.as_str()]).fails();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_complement_1_unique_in_set2() {
|
||||
let x226 = "x".repeat(226);
|
||||
|
||||
// [y*] is expanded to "" here
|
||||
let arg = x226 + "[y*]xxxx";
|
||||
new_ucmd!()
|
||||
.args(&["-c", "[:upper:]", arg.as_str()])
|
||||
.succeeds();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue