]> git.proxmox.com Git - rustc.git/blob - library/std/src/sys/unix/os_str/tests.rs
New upstream version 1.74.1+dfsg1
[rustc.git] / library / std / src / sys / unix / os_str / tests.rs
1 use super::*;
2
3 #[test]
4 fn slice_debug_output() {
5 let input = unsafe { Slice::from_encoded_bytes_unchecked(b"\xF0hello,\tworld") };
6 let expected = r#""\xF0hello,\tworld""#;
7 let output = format!("{input:?}");
8
9 assert_eq!(output, expected);
10 }
11
12 #[test]
13 fn display() {
14 assert_eq!("Hello\u{FFFD}\u{FFFD} There\u{FFFD} Goodbye", unsafe {
15 Slice::from_encoded_bytes_unchecked(b"Hello\xC0\x80 There\xE6\x83 Goodbye").to_string()
16 },);
17 }