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

test_printf: add test for additional escape (\c)

Using this escaped character will cause `printf` to stop generating characters.

For instance,

```rust
hbina@akarin ~/g/uutils (hbina-add-test-for-additional-escape)> cargo run --quiet -- printf "%s\c%s" a b
a⏎
```

Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
This commit is contained in:
Hanif Ariffin 2022-02-04 18:47:19 +08:00
parent 572a505119
commit 793d3dd97c

View file

@ -429,3 +429,11 @@ fn sub_any_specifiers_after_second_param() {
.succeeds()
.stdout_only("3");
}
#[test]
fn stop_after_additional_escape() {
new_ucmd!()
.args(&["A%sC\\cD%sF", "B", "E"]) //spell-checker:disable-line
.succeeds()
.stdout_only("ABC");
}