Skip to content

Commit 262d154

Browse files
committed
libstd: Add unit tests for slice_shift_char
1 parent 0349f2a commit 262d154

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/libstd/str.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3618,6 +3618,18 @@ mod tests {
36183618
assert!(!" _ ".is_whitespace());
36193619
}
36203620

3621+
#[test]
3622+
fn test_slice_shift_char() {
3623+
let data = "ประเทศไทย中";
3624+
assert_eq!(data.slice_shift_char(), (Some('ป'), "ระเทศไทย中"));
3625+
}
3626+
3627+
#[test]
3628+
fn test_slice_shift_char_2() {
3629+
let empty = "";
3630+
assert_eq!(empty.slice_shift_char(), (None, ""));
3631+
}
3632+
36213633
#[test]
36223634
fn test_push_byte() {
36233635
let mut s = ~"ABC";

0 commit comments

Comments
 (0)