From 9862b5929c795951a2a0718fe2e566f3a7085dbc Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Thu, 7 Sep 2023 11:16:59 +0200 Subject: [PATCH] Beefing up test --- embedded-io/src/impls/slice_mut.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/embedded-io/src/impls/slice_mut.rs b/embedded-io/src/impls/slice_mut.rs index 3bee82faf..9bc074bfd 100644 --- a/embedded-io/src/impls/slice_mut.rs +++ b/embedded-io/src/impls/slice_mut.rs @@ -39,6 +39,7 @@ mod test { let mut buf = [0u8; 1024]; let len = write!(&mut buf[..], "Hello!").unwrap(); assert!(len == "Hello!".as_bytes().len()); + assert!(core::str::from_utf8(&buf[..len]).unwrap() == "Hello!"); } #[test] @@ -46,5 +47,6 @@ mod test { let mut buf = [0u8; 1024]; let len = write!(&mut buf[..], "Hello, {}!", "World").unwrap(); assert!(len == "Hello, World!".as_bytes().len()); + assert!(core::str::from_utf8(&buf[..len]).unwrap() == "Hello, World!"); } }