tests/printf: Verify the correct error behavior of printf when provided with '%0c' or '%0s'

This commit is contained in:
Dorian Péron
2024-03-01 00:02:31 +01:00
parent 75b2bfb111
commit 58ee0ce427
+12
View File
@@ -765,3 +765,15 @@ fn pad_string() {
.stdout_only(expected);
}
}
#[test]
fn format_spec_zero_char_fails() {
// It is invalid to have the format spec '%0c'
new_ucmd!().args(&["%0c", "3"]).fails().code_is(1);
}
#[test]
fn format_spec_zero_string_fails() {
// It is invalid to have the format spec '%0s'
new_ucmd!().args(&["%0s", "3"]).fails().code_is(1);
}