Skip to content

Commit b0e9bb4

Browse files
dnwiebeBert
andauthored
GH-625: Log message enhancements, plus clippy appeasement (#153)
* Log message enhancements, plus clippy appeasement * GH-627: Clippy should be happy again by now * GH-627: one line was silly * GH-627: starting ignoring the troublesome test again * GH-627: there was a formatting issue * handles_startup_and_shutdown_integration now doesn't run in Actions on Windows * handles_startup_and_shutdown_integration now doesn't run in Actions on Windows * Added import * GH-625: Formatting * GH-625: Remember to return Co-authored-by: Bert <[email protected]>
1 parent c9bbe5d commit b0e9bb4

File tree

3 files changed

+51
-38
lines changed

3 files changed

+51
-38
lines changed

masq/src/commands/commands_common.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,17 @@ impl Display for CommandError {
3333
Transmission(s) => format!("Transmission problem: {}", s),
3434
Reception(s) => format!("Reception problem: {}", s),
3535
UnexpectedResponse(e) => format!("{}", e),
36-
Payload(code, s) => format!("{} (Code {})", s, code),
36+
Payload(code, s) => {
37+
let pure_hex_string = format!("{:016X}", code);
38+
let expanded_hex_string = format!(
39+
"{}_{}_{}_{}",
40+
&pure_hex_string[0..4],
41+
&pure_hex_string[4..8],
42+
&pure_hex_string[8..12],
43+
&pure_hex_string[12..16]
44+
);
45+
format!("{} (Code {})", s, expanded_hex_string)
46+
}
3747
Other(s) => s.to_string(),
3848
};
3949
write!(f, "{}", msg)
@@ -244,7 +254,7 @@ mod tests {
244254
);
245255
assert_eq!(
246256
format!("{}", Payload(1234, "string".to_string())),
247-
"string (Code 1234)".to_string()
257+
"string (Code 0000_0000_0000_04D2)".to_string()
248258
);
249259
assert_eq!(
250260
format!("{}", Other("string".to_string())),

masq/tests/startup_shutdown_tests_integration.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ fn masq_terminates_based_on_loss_of_connection_to_the_daemon_integration() {
9696
#[test]
9797
fn handles_startup_and_shutdown_integration() {
9898
if cfg!(windows) && is_running_under_github_actions() {
99-
eprintln!("This test is not run in Actions under Windows, because it's flaky there.")
99+
eprintln!("This test is not run in Actions under Windows, because it's flaky there.");
100+
return;
100101
}
101102
let dir_path = ensure_node_home_directory_exists(
102103
"masq_integration_tests",

0 commit comments

Comments
 (0)