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

tr: raise an error when there are two chars or more in an equivalence class

This commit is contained in:
Dorian Peron 2025-02-18 04:04:36 +01:00 committed by Dorian Peron
parent 99d4fbdd85
commit 989b6ba2a0
2 changed files with 44 additions and 11 deletions

View file

@ -1166,6 +1166,15 @@ fn check_against_gnu_tr_tests_empty_eq() {
.stderr_is("tr: missing equivalence class character '[==]'\n");
}
#[test]
fn check_too_many_chars_in_eq() {
new_ucmd!()
.args(&["-d", "[=aa=]"])
.pipe_in("")
.fails()
.stderr_contains("aa: equivalence class operand must be a single character\n");
}
#[test]
fn check_against_gnu_tr_tests_empty_cc() {
// ['empty-cc', qw('[::]' x), {IN=>''}, {OUT=>''}, {EXIT=>1},