docs: Remove extraneous whitespace

Remove trailing whitespace in the unit test advice doc.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt 2021-11-25 14:44:07 +00:00
parent aff3275608
commit f0734f52c1

View File

@ -222,7 +222,7 @@ mod tests {
num: i32, num: i32,
result: Result<String>, result: Result<String>,
} }
// The tests can now be specified as a set of inputs and outputs // The tests can now be specified as a set of inputs and outputs
let tests = &[ let tests = &[
// Failure scenarios // Failure scenarios
@ -249,24 +249,24 @@ mod tests {
result: Ok("--1".to_string()), result: Ok("--1".to_string()),
}, },
]; ];
// Run the tests // Run the tests
for (i, d) in tests.iter().enumerate() { for (i, d) in tests.iter().enumerate() {
// Create a string containing details of the test // Create a string containing details of the test
let msg = format!("test[{}]: {:?}", i, d); let msg = format!("test[{}]: {:?}", i, d);
// Call the function under test // Call the function under test
let result = join_params_with_dash(d.str, d.num); let result = join_params_with_dash(d.str, d.num);
// Update the test details string with the results of the call // Update the test details string with the results of the call
let msg = format!("{}, result: {:?}", msg, result); let msg = format!("{}, result: {:?}", msg, result);
// Perform the checks // Perform the checks
if d.result.is_ok() { if d.result.is_ok() {
assert!(result == d.result, msg); assert!(result == d.result, msg);
continue; continue;
} }
let expected_error = format!("{}", d.result.as_ref().unwrap_err()); let expected_error = format!("{}", d.result.as_ref().unwrap_err());
let actual_error = format!("{}", result.unwrap_err()); let actual_error = format!("{}", result.unwrap_err());
assert!(actual_error == expected_error, msg); assert!(actual_error == expected_error, msg);