Skip to content

Commit

Permalink
add test for text input unicode handling
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesvdv committed Apr 16, 2017
1 parent 26e6c09 commit 49ea443
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/unit/script/textinput.rs
Expand Up @@ -496,3 +496,13 @@ fn test_textinput_set_selection_with_direction() {
assert_eq!(textinput.selection_begin.unwrap().line, 0);
assert_eq!(textinput.selection_begin.unwrap().index, 6);
}

#[test]
fn test_textinput_unicode_handling() {
let mut textinput = text_input(Lines::Single, "éèùµ$£");
assert_eq!(textinput.edit_point.index, 0);
textinput.set_edit_point_index(1);
assert_eq!(textinput.edit_point.index, 2);
textinput.set_edit_point_index(4);
assert_eq!(textinput.edit_point.index, 8);
}

0 comments on commit 49ea443

Please sign in to comment.