From 3cdb0966ae1b86724be8f7b6db2b6f41472169fc Mon Sep 17 00:00:00 2001 From: ALXD Date: Wed, 15 Nov 2023 17:46:58 +0100 Subject: [PATCH] printf: add a test for %x with invalid value --- tests/by-util/test_printf.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/by-util/test_printf.rs b/tests/by-util/test_printf.rs index a297dbf68..ab3505a32 100644 --- a/tests/by-util/test_printf.rs +++ b/tests/by-util/test_printf.rs @@ -258,6 +258,14 @@ fn sub_num_hex_upper() { .stdout_only("thirty in hex is 1E"); } +#[test] +fn sub_num_hex_non_numerical() { + new_ucmd!() + .args(&["parameters need to be numbers %X", "%194"]) + .fails() + .code_is(1); +} + #[test] fn sub_num_float() { new_ucmd!()