Skip to content

Commit

Permalink
Add variable names in test result string.
Browse files Browse the repository at this point in the history
  • Loading branch information
DFINITYManu committed Nov 5, 2024
1 parent 7afbacd commit 1da7860
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions rs/linux_kernel_command_line/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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",
)
}
}
Expand Down

0 comments on commit 1da7860

Please sign in to comment.