diff --git a/tests/cxx_string.rs b/tests/cxx_string.rs index d651408ea..878be942b 100644 --- a/tests/cxx_string.rs +++ b/tests/cxx_string.rs @@ -21,6 +21,13 @@ fn test_async_cxx_string() { assert_send(f()); } +#[test] +fn test_display() { + let_cxx_string!(s = b"w\"x\'y\xF1\x80\xF1\x80z"); + + assert_eq!(format!("{}", s), "w\"x'y\u{fffd}\u{fffd}z"); +} + #[test] fn test_debug() { let_cxx_string!(s = b"w\"x\'y\xF1\x80z");