summaryrefslogtreecommitdiffstats
path: root/library/core/tests/char.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/tests/char.rs')
-rw-r--r--library/core/tests/char.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/core/tests/char.rs b/library/core/tests/char.rs
index 8542e5c70..ac0b2ca16 100644
--- a/library/core/tests/char.rs
+++ b/library/core/tests/char.rs
@@ -306,6 +306,10 @@ fn test_decode_utf16() {
}
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]