diff options
| author | Tamir Duberstein <tamird@gmail.com> | 2025-04-18 10:30:38 -0400 |
|---|---|---|
| committer | Tamir Duberstein <tamird@gmail.com> | 2025-04-18 10:31:55 -0400 |
| commit | 9058bab9a9e88b90596019f686cce1f21ac19ef8 (patch) | |
| tree | 88cd28928407f2f2d23b63d48fce4253a2a06f48 | |
| parent | f727b3622bf69f44500e708f387160d5afbb39db (diff) | |
| download | rust-9058bab9a9e88b90596019f686cce1f21ac19ef8.tar.gz rust-9058bab9a9e88b90596019f686cce1f21ac19ef8.zip | |
Move `<CStr as Debug>` test to coretests
| -rw-r--r-- | library/alloctests/tests/c_str2.rs | 6 | ||||
| -rw-r--r-- | library/coretests/tests/ffi/cstr.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/library/alloctests/tests/c_str2.rs b/library/alloctests/tests/c_str2.rs index 0f4c27fa123..fe7686bd1c5 100644 --- a/library/alloctests/tests/c_str2.rs +++ b/library/alloctests/tests/c_str2.rs @@ -34,12 +34,6 @@ fn build_with_zero2() { } #[test] -fn formatted() { - let s = CString::new(&b"abc\x01\x02\n\xE2\x80\xA6\xFF"[..]).unwrap(); - assert_eq!(format!("{s:?}"), r#""abc\x01\x02\n\xe2\x80\xa6\xff""#); -} - -#[test] fn borrowed() { unsafe { let s = CStr::from_ptr(b"12\0".as_ptr() as *const _); diff --git a/library/coretests/tests/ffi/cstr.rs b/library/coretests/tests/ffi/cstr.rs index 9bf4c21a9ab..0d85b22c585 100644 --- a/library/coretests/tests/ffi/cstr.rs +++ b/library/coretests/tests/ffi/cstr.rs @@ -13,3 +13,9 @@ fn compares_as_u8s() { assert_eq!(Ord::cmp(a, b), Ord::cmp(a_bytes, b_bytes)); assert_eq!(PartialOrd::partial_cmp(a, b), PartialOrd::partial_cmp(a_bytes, b_bytes)); } + +#[test] +fn debug() { + let s = c"abc\x01\x02\n\xE2\x80\xA6\xFF"; + assert_eq!(format!("{s:?}"), r#""abc\x01\x02\n\xe2\x80\xa6\xff""#); +} |
