libstd: Add unit tests for slice_shift_char

This commit is contained in:
Piotr Czarnecki 2014-03-09 22:56:33 +01:00
parent 0349f2ae8a
commit 262d1543db

View File

@ -3618,6 +3618,18 @@ mod tests {
assert!(!" _ ".is_whitespace());
}
#[test]
fn test_slice_shift_char() {
let data = "ประเทศไทย中";
assert_eq!(data.slice_shift_char(), (Some('ป'), "ระเทศไทย中"));
}
#[test]
fn test_slice_shift_char_2() {
let empty = "";
assert_eq!(empty.slice_shift_char(), (None, ""));
}
#[test]
fn test_push_byte() {
let mut s = ~"ABC";