mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
Merge pull request #7897 from aaron-ang/ptx-panic
ptx: use char count instead of byte index to handle utf-8 characters
This commit is contained in:
commit
bcc02e9cea
2 changed files with 63 additions and 32 deletions
|
@ -174,3 +174,17 @@ fn test_failed_write_is_reported() {
|
|||
.fails()
|
||||
.stderr_is("ptx: write failed: No space left on device\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_utf8() {
|
||||
new_ucmd!()
|
||||
.args(&["-G"])
|
||||
.pipe_in("it’s disabled\n")
|
||||
.succeeds()
|
||||
.stdout_only(".xx \"\" \"it’s\" \"disabled\" \"\"\n.xx \"\" \"\" \"it’s disabled\" \"\"\n");
|
||||
new_ucmd!()
|
||||
.args(&["-G", "-T"])
|
||||
.pipe_in("it’s disabled\n")
|
||||
.succeeds()
|
||||
.stdout_only("\\xx {}{it’s}{disabled}{}{}\n\\xx {}{}{it’s}{ disabled}{}\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue