aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/script/textinput.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/script/textinput.rs')
-rw-r--r--tests/unit/script/textinput.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/script/textinput.rs b/tests/unit/script/textinput.rs
index 73d99cf1588..f4e65a0e1d3 100644
--- a/tests/unit/script/textinput.rs
+++ b/tests/unit/script/textinput.rs
@@ -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());
+}