diff options
Diffstat (limited to 'src/libcoretest')
| -rw-r--r-- | src/libcoretest/str.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcoretest/str.rs b/src/libcoretest/str.rs index 5f44fd807cc..9574aeb3762 100644 --- a/src/libcoretest/str.rs +++ b/src/libcoretest/str.rs @@ -114,3 +114,10 @@ fn test_rev_split_char_iterator_no_trailing() { split.reverse(); assert_eq!(split, vec!["", "Märy häd ä little lämb", "Little lämb"]); } + +#[test] +fn test_utf16_code_units() { + use core::str::Utf16Encoder; + assert_eq!(Utf16Encoder::new(vec!['é', '\U0001F4A9'].into_iter()).collect::<Vec<u16>>(), + vec![0xE9, 0xD83D, 0xDCA9]) +} |
