diff --git a/src/packages/string_basic.rs b/src/packages/string_basic.rs index 44ab4e7e..69e53bf1 100644 --- a/src/packages/string_basic.rs +++ b/src/packages/string_basic.rs @@ -172,8 +172,7 @@ mod print_debug_functions { let len = map.len(); map.iter_mut().enumerate().for_each(|(i, (k, v))| { - result.push_str(k); - result.push_str(": "); + result.push_str(&format!("{:?}: ", k)); result.push_str(&print_with_func(FUNC_TO_DEBUG, &ctx, v)); if i < len - 1 { result.push_str(", "); diff --git a/tests/print.rs b/tests/print.rs index 7967670a..3d4c34a7 100644 --- a/tests/print.rs +++ b/tests/print.rs @@ -73,6 +73,6 @@ fn test_print_custom_type() -> Result<(), Box> { x.to_string() "# )? - .contains("e: hello: 42")); + .contains(r#""e": hello: 42"#)); Ok(()) }