1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 03:26:18 +00:00

Merge pull request #5640 from tertsdiepraam/tr-no-output

`tr`: operate on bytes instead of chars
This commit is contained in:
Sylvestre Ledru 2023-12-19 11:42:44 +01:00 committed by GitHub
commit 9920f13a34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 115 additions and 151 deletions

View file

@ -29,12 +29,12 @@ fn test_small_set2() {
}
#[test]
fn test_unicode() {
fn test_invalid_unicode() {
new_ucmd!()
.args(&[", ┬─┬", "╯︵┻━┻"])
.pipe_in("(,°□°), ┬─┬")
.run()
.stdout_is("(╯°□°)╯︵┻━┻");
.args(&["-dc", "abc"])
.pipe_in([0o200, b'a', b'b', b'c'])
.succeeds()
.stdout_is("abc");
}
#[test]
@ -733,10 +733,11 @@ fn check_against_gnu_tr_tests_w() {
// {IN=>"\300\301\377\345\345\350\345"},
// {OUT=>"\300\301\377\345"}],
new_ucmd!()
.args(&["-ds", "\u{350}", "\u{345}"])
.pipe_in("\u{300}\u{301}\u{377}\u{345}\u{345}\u{350}\u{345}")
.arg("-ds")
.args(&["\\350", "\\345"])
.pipe_in([0o300, 0o301, 0o377, 0o345, 0o345, 0o350, 0o345])
.succeeds()
.stdout_is("\u{300}\u{301}\u{377}\u{345}");
.stdout_is_bytes([0o300, 0o301, 0o377, 0o345]);
}
#[test]