]> git.lizzy.rs Git - rust.git/blobdiff - library/core/tests/char.rs
Rollup merge of #106823 - m-ou-se:format-args-as-str-guarantees, r=dtolnay
[rust.git] / library / core / tests / char.rs
index 8542e5c70d40c00241e0045971d1afcd97dc4290..ac0b2ca168b237133727fcfccab3470844cf4563 100644 (file)
@@ -306,6 +306,10 @@ fn check(s: &[u16], expected: &[Result<char, u16>]) {
     }
     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]