X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=library%2Fcore%2Ftests%2Fchar.rs;h=ac0b2ca168b237133727fcfccab3470844cf4563;hb=0c53b215de0c57833756300e81ac9c5f84a541a3;hp=8542e5c70d40c00241e0045971d1afcd97dc4290;hpb=7b9c8c87819d0d122f56017f5e093ea8c082dc69;p=rust.git diff --git a/library/core/tests/char.rs b/library/core/tests/char.rs index 8542e5c70d4..ac0b2ca168b 100644 --- a/library/core/tests/char.rs +++ b/library/core/tests/char.rs @@ -306,6 +306,10 @@ fn check(s: &[u16], expected: &[Result]) { } check(&[0xD800, 0x41, 0x42], &[Err(0xD800), Ok('A'), Ok('B')]); check(&[0xD800, 0], &[Err(0xD800), Ok('\0')]); + check(&[0xD800], &[Err(0xD800)]); + check(&[0xD840, 0xDC00], &[Ok('\u{20000}')]); + check(&[0xD840, 0xD840, 0xDC00], &[Err(0xD840), Ok('\u{20000}')]); + check(&[0xDC00, 0xD840], &[Err(0xDC00), Err(0xD840)]); } #[test]