summaryrefslogtreecommitdiffstats
path: root/library/std/src/sys/unix/os_str/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/sys/unix/os_str/tests.rs')
-rw-r--r--library/std/src/sys/unix/os_str/tests.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/library/std/src/sys/unix/os_str/tests.rs b/library/std/src/sys/unix/os_str/tests.rs
index 22ba0c923..91bc0e61a 100644
--- a/library/std/src/sys/unix/os_str/tests.rs
+++ b/library/std/src/sys/unix/os_str/tests.rs
@@ -2,7 +2,7 @@ use super::*;
#[test]
fn slice_debug_output() {
- let input = Slice::from_u8_slice(b"\xF0hello,\tworld");
+ let input = unsafe { Slice::from_os_str_bytes_unchecked(b"\xF0hello,\tworld") };
let expected = r#""\xF0hello,\tworld""#;
let output = format!("{input:?}");
@@ -11,8 +11,7 @@ fn slice_debug_output() {
#[test]
fn display() {
- assert_eq!(
- "Hello\u{FFFD}\u{FFFD} There\u{FFFD} Goodbye",
- Slice::from_u8_slice(b"Hello\xC0\x80 There\xE6\x83 Goodbye").to_string(),
- );
+ assert_eq!("Hello\u{FFFD}\u{FFFD} There\u{FFFD} Goodbye", unsafe {
+ Slice::from_os_str_bytes_unchecked(b"Hello\xC0\x80 There\xE6\x83 Goodbye").to_string()
+ },);
}