Skip to content

Commit 96322f1

Browse files
another test
1 parent f76042d commit 96322f1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/std/src/sys_common/wtf8/tests.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,3 +750,11 @@ fn unwobbly_wtf8_plus_utf8_is_utf8() {
750750
string.push_str("some utf-8");
751751
assert!(string.is_known_utf8);
752752
}
753+
754+
#[test]
755+
fn unwobbly_wtf8_plus_wobbled_bytes_isnt_utf8() {
756+
let mut string: Wtf8Buf = Wtf8Buf::from_str("hello world");
757+
assert!(string.is_known_utf8);
758+
string.extend_from_slice(b"\xED\xa0\x80");
759+
assert!(!string.is_known_utf8);
760+
}

0 commit comments

Comments
 (0)