We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fda509e commit ecce230Copy full SHA for ecce230
library/std/src/sys_common/wtf8/tests.rs
@@ -725,3 +725,12 @@ fn wtf8_utf8_boundary_between_surrogates() {
725
string.push(CodePoint::from_u32(0xD800).unwrap());
726
check_utf8_boundary(&string, 3);
727
}
728
+
729
+#[test]
730
+fn wtf8_not_utf8_isnt_utf8() {
731
+ let mut string: Wtf8Buf = unsafe { Wtf8::from_bytes_unchecked(b"\xED\xA0\x80").to_owned() };
732
+ assert_eq!(string.bytes, b"\xED\xA0\x80");
733
+ assert!(!string.is_known_utf8);
734
+ string.extend_from_slice(b"some utf-8");
735
736
+}
0 commit comments