mirror of
https://github.com/servo/servo.git
synced 2025-08-26 15:48:22 +01:00
Auto merge of #22136 - pyfisch:fix-select-all, r=jdm
Correct select all Fixes assertion failure. Set selection direction forward on select all. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22136) <!-- Reviewable:end -->
This commit is contained in:
commit
44b75ed588
2 changed files with 11 additions and 0 deletions
|
@ -699,3 +699,13 @@ fn test_selection_bounds() {
|
|||
assert_eq!(TextPoint { line: 0, index: 0 }, textinput.selection_start());
|
||||
assert_eq!(TextPoint { line: 1, index: 0 }, textinput.selection_end());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_select_all() {
|
||||
let mut textinput = text_input(Lines::Single, "abc");
|
||||
textinput.set_selection_range(2, 3, SelectionDirection::Backward);
|
||||
textinput.select_all();
|
||||
assert_eq!(textinput.selection_direction(), SelectionDirection::Forward);
|
||||
assert_eq!(TextPoint { line: 0, index: 0 }, textinput.selection_start());
|
||||
assert_eq!(TextPoint { line: 0, index: 3 }, textinput.selection_end());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue