diff options
| author | GrantBirki <grant.birkinbine@gmail.com> | 2025-05-16 22:42:05 -0700 |
|---|---|---|
| committer | GrantBirki <grant.birkinbine@gmail.com> | 2025-05-16 22:42:05 -0700 |
| commit | 604f0e27436b4940399873d0c23e5b609a52e831 (patch) | |
| tree | 652ce20f186ea6b74fe65e662f9396aa400e4256 /library/std/tests | |
| parent | 49658e6a3c528dec342d82920f4606dab4d90ae8 (diff) | |
| download | rust-604f0e27436b4940399873d0c23e5b609a52e831.tar.gz rust-604f0e27436b4940399873d0c23e5b609a52e831.zip | |
remove `test_embedded_null_byte()` test for now
Diffstat (limited to 'library/std/tests')
| -rw-r--r-- | library/std/tests/path.rs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/library/std/tests/path.rs b/library/std/tests/path.rs index 7107d416056..a6f679d0ffb 100644 --- a/library/std/tests/path.rs +++ b/library/std/tests/path.rs @@ -15,13 +15,6 @@ use std::ptr; use std::rc::Rc; use std::sync::Arc; -#[cfg(unix)] -use std::os::unix::ffi::OsStrExt; -#[cfg(windows)] -use std::os::windows::ffi::OsStrExt; -#[cfg(windows)] -use std::os::windows::ffi::OsStringExt; - #[allow(unknown_lints, unused_macro_rules)] macro_rules! t ( ($path:expr, iter: $iter:expr) => ( @@ -2005,19 +1998,6 @@ fn test_non_ascii_unicode() { assert_eq!(path.file_name(), Some(OsStr::new("file.txt"))); } -// Test: Embedded null bytes -// This test checks that Path can be constructed from a byte slice containing a null byte (on Unix). -// It ensures that null bytes are not treated as string terminators. -#[test] -fn test_embedded_null_byte() { - use std::ffi::OsStr; - let bytes = b"foo\0bar"; - let os_str = OsStr::from_bytes(bytes); - let path = Path::new(os_str); - assert!(path.as_os_str().as_bytes().contains(&0)); - assert_eq!(path.file_name(), Some(OsStr::new("foo\0bar"))); - assert_eq!(path.to_str(), Some("foo\0bar")); -} // Test: Reserved device names (Windows) // This test ensures that reserved device names like "CON", "PRN", etc., are handled as normal paths on non-Windows platforms, |
