Skip to content

Commit 604f0e2

Browse files
committed
remove test_embedded_null_byte() test for now
1 parent 49658e6 commit 604f0e2

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

library/std/tests/path.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ use std::ptr;
1515
use std::rc::Rc;
1616
use std::sync::Arc;
1717

18-
#[cfg(unix)]
19-
use std::os::unix::ffi::OsStrExt;
20-
#[cfg(windows)]
21-
use std::os::windows::ffi::OsStrExt;
22-
#[cfg(windows)]
23-
use std::os::windows::ffi::OsStringExt;
24-
2518
#[allow(unknown_lints, unused_macro_rules)]
2619
macro_rules! t (
2720
($path:expr, iter: $iter:expr) => (
@@ -2005,19 +1998,6 @@ fn test_non_ascii_unicode() {
20051998
assert_eq!(path.file_name(), Some(OsStr::new("file.txt")));
20061999
}
20072000

2008-
// Test: Embedded null bytes
2009-
// This test checks that Path can be constructed from a byte slice containing a null byte (on Unix).
2010-
// It ensures that null bytes are not treated as string terminators.
2011-
#[test]
2012-
fn test_embedded_null_byte() {
2013-
use std::ffi::OsStr;
2014-
let bytes = b"foo\0bar";
2015-
let os_str = OsStr::from_bytes(bytes);
2016-
let path = Path::new(os_str);
2017-
assert!(path.as_os_str().as_bytes().contains(&0));
2018-
assert_eq!(path.file_name(), Some(OsStr::new("foo\0bar")));
2019-
assert_eq!(path.to_str(), Some("foo\0bar"));
2020-
}
20212001

20222002
// Test: Reserved device names (Windows)
20232003
// This test ensures that reserved device names like "CON", "PRN", etc., are handled as normal paths on non-Windows platforms,

0 commit comments

Comments
 (0)