Skip to content

Commit

Permalink
Beefing up test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-summers committed Sep 7, 2023
1 parent 0c0b2af commit 9862b59
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions embedded-io/src/impls/slice_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ 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]
fn format_length() {
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!");
}
}

0 comments on commit 9862b59

Please sign in to comment.