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

echo: add support for \NNN octal escape sequence

This commit is contained in:
Terts Diepraam 2023-08-29 21:54:19 +02:00
parent 4623575a66
commit 1ad10dd371
2 changed files with 37 additions and 0 deletions

View file

@ -253,3 +253,30 @@ fn wrapping_octal() {
.succeeds()
.stdout_is("A\n");
}
#[test]
fn old_octal_syntax() {
new_ucmd!()
.arg("-e")
.arg("\\1foo")
.succeeds()
.stdout_is("\x01foo\n");
new_ucmd!()
.arg("-e")
.arg("\\43foo")
.succeeds()
.stdout_is("#foo\n");
new_ucmd!()
.arg("-e")
.arg("\\101foo")
.succeeds()
.stdout_is("Afoo\n");
new_ucmd!()
.arg("-e")
.arg("\\1011")
.succeeds()
.stdout_is("A1\n");
}