]> git.lizzy.rs Git - rust.git/blob - library/std/src/sys_common/bytestring/tests.rs
Auto merge of #86166 - tmiasko:no-alloca-for-zsts, r=nagisa
[rust.git] / library / std / src / sys_common / bytestring / tests.rs
1 use super::*;
2 use crate::fmt::{Debug, Formatter, Result};
3
4 #[test]
5 fn smoke() {
6     struct Helper<'a>(&'a [u8]);
7
8     impl Debug for Helper<'_> {
9         fn fmt(&self, f: &mut Formatter<'_>) -> Result {
10             debug_fmt_bytestring(self.0, f)
11         }
12     }
13
14     let input = b"\xF0hello,\tworld";
15     let expected = r#""\xF0hello,\tworld""#;
16     let output = format!("{:?}", Helper(input));
17
18     assert!(output == expected);
19 }