mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Use correct byte indices in replace_selection
This commit is contained in:
parent
0397e2a24d
commit
d7e6f8b0f1
2 changed files with 22 additions and 3 deletions
|
@ -206,6 +206,15 @@ fn test_textinput_replace_selection() {
|
|||
assert_eq!(textinput.get_content(), "abxyzefg");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_textinput_replace_selection_multibyte_char() {
|
||||
let mut textinput = text_input(Lines::Single, "é");
|
||||
textinput.adjust_horizontal_by_one(Direction::Forward, Selection::Selected);
|
||||
|
||||
textinput.replace_selection(DOMString::from("e"));
|
||||
assert_eq!(textinput.get_content(), "e");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_textinput_current_line_length() {
|
||||
let mut textinput = text_input(Lines::Multiple, "abc\nde\nf");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue