mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
printf: support for extract chars
Should fix tests/printf/printf-mb.sh
This commit is contained in:
parent
79cb095636
commit
af577e7a14
2 changed files with 30 additions and 7 deletions
|
@ -1291,10 +1291,25 @@ fn float_arg_with_whitespace() {
|
|||
|
||||
#[test]
|
||||
fn mb_input() {
|
||||
for format in ["\"á", "\'á"] {
|
||||
for format in ["\"á", "\'á", "'\u{e1}"] {
|
||||
new_ucmd!()
|
||||
.args(&["%04x\n", format])
|
||||
.succeeds()
|
||||
.stdout_only("00e1\n");
|
||||
}
|
||||
|
||||
let cases = vec![
|
||||
("\"á=", "="),
|
||||
("\'á-", "-"),
|
||||
("\'á=-==", "=-=="),
|
||||
("'\u{e1}++", "++"),
|
||||
];
|
||||
|
||||
for (format, expected) in cases {
|
||||
new_ucmd!()
|
||||
.args(&["%04x\n", format])
|
||||
.succeeds()
|
||||
.stdout_is("00e1\n")
|
||||
.stderr_is(format!("printf: warning: {expected}: character(s) following character constant have been ignored\n"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue