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

Allow echo with escapes to work with \0

Testing with gecho on macos outputs a nul character for a \0
This commit is contained in:
Zachary Dremann 2022-01-30 17:15:29 -05:00
parent 7b3cfcf708
commit d6a0b3c920
2 changed files with 11 additions and 6 deletions

View file

@ -138,11 +138,19 @@ fn test_escape_short_octal() {
}
#[test]
fn test_escape_no_octal() {
fn test_escape_nul() {
new_ucmd!()
.args(&["-e", "foo\\0 bar"])
.succeeds()
.stdout_only("foo\\0 bar\n");
.stdout_only("foo\0 bar\n");
}
#[test]
fn test_escape_octal_invalid_digit() {
new_ucmd!()
.args(&["-e", "foo\\08 bar"])
.succeeds()
.stdout_only("foo\u{0}8 bar\n");
}
#[test]