Skip to content

Commit

Permalink
Add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
cvonelm committed Jun 15, 2024
1 parent 08717c3 commit 202f5b6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/by-util/test_tr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1374,3 +1374,23 @@ fn check_disallow_blank_in_set2_when_translating() {
fn check_class_in_set2_must_be_matched_in_set1() {
new_ucmd!().args(&["-t", "1[:upper:]", "[:upper:]"]).fails();
}

#[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();
}

0 comments on commit 202f5b6

Please sign in to comment.