From 1da78607ddffda2fd2e3b00ed1b7fc0ef49a1e9c Mon Sep 17 00:00:00 2001 From: Manuel Amador Date: Tue, 5 Nov 2024 14:35:42 +0100 Subject: [PATCH] Add variable names in test result string. --- rs/linux_kernel_command_line/src/lib.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/rs/linux_kernel_command_line/src/lib.rs b/rs/linux_kernel_command_line/src/lib.rs index 071a3f81f29..ccd28c10579 100644 --- a/rs/linux_kernel_command_line/src/lib.rs +++ b/rs/linux_kernel_command_line/src/lib.rs @@ -251,15 +251,13 @@ mod tests { let result: String = cmdline.into(); if result != *expected { panic!( - "During test {}: -input: {:?} -argument: {:?} -expected: {:?} -actual: {:?}", - name, input, argument_to_remove, expected, result + "During test {name}: +input: {input:?} +argument: {argument_to_remove:?} +expected: {expected:?} +actual: {result:?}", ); } - println!("{:?}", result); } } @@ -282,8 +280,7 @@ actual: {:?}", for (name, input) in table.iter() { if KernelCommandLine::try_from(*input).is_ok() { panic!( - "During test {}: input {:?} intentionally misquoted argument did not trigger error", - name, input + "During test {name}: input {input:?} intentionally misquoted argument did not trigger error", ) } }