From e652f97c6b71d485473c98bb0e5be1328db9bc45 Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Fri, 12 Sep 2025 11:10:45 -0500 Subject: [PATCH] Improve `core::ascii` coverage --- library/coretests/tests/ascii.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/coretests/tests/ascii.rs b/library/coretests/tests/ascii.rs index ce09ee507f11f..297aa114e006d 100644 --- a/library/coretests/tests/ascii.rs +++ b/library/coretests/tests/ascii.rs @@ -505,3 +505,10 @@ fn test_escape_ascii_iter() { let _ = it.advance_back_by(4); assert_eq!(it.to_string(), r#"fastpath\xffremainder"#); } + +#[test] +fn test_invalid_u8() { + for c in 128..=255 { + assert_eq!(core::ascii::Char::from_u8(c), None); + } +}