aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/script/textinput.rs
diff options
context:
space:
mode:
authorAvi Weinstock <aweinstock314@gmail.com>2015-06-18 11:58:03 -0400
committerAvi Weinstock <aweinstock314@gmail.com>2015-07-29 12:19:37 -0400
commitf86252a60bf9f4496fb010b5d1d3f9fc3648467f (patch)
tree73afbca5443fc2c0aa6677e15b9716212d8e4a3b /tests/unit/script/textinput.rs
parent52c2049f2a47c814888e98c509eac83dc071e829 (diff)
downloadservo-f86252a60bf9f4496fb010b5d1d3f9fc3648467f.tar.gz
servo-f86252a60bf9f4496fb010b5d1d3f9fc3648467f.zip
Add set_clipboard_context function and relevant plumbing. Use Option more consistantly (less unwraps) in textinput's selection handling.
Diffstat (limited to 'tests/unit/script/textinput.rs')
-rw-r--r--tests/unit/script/textinput.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/script/textinput.rs b/tests/unit/script/textinput.rs
index 1c364d5739a..4d59ebf2869 100644
--- a/tests/unit/script/textinput.rs
+++ b/tests/unit/script/textinput.rs
@@ -50,14 +50,14 @@ fn test_textinput_get_sorted_selection() {
let mut textinput = TextInput::new(Lines::Single, "abcdefg".to_owned(), DummyClipboardContext::new(""));
textinput.adjust_horizontal(2, Selection::NotSelected);
textinput.adjust_horizontal(2, Selection::Selected);
- let (begin, end) = textinput.get_sorted_selection();
+ let (begin, end) = textinput.get_sorted_selection().unwrap();
assert_eq!(begin.index, 2);
assert_eq!(end.index, 4);
textinput.clear_selection();
textinput.adjust_horizontal(-2, Selection::Selected);
- let (begin, end) = textinput.get_sorted_selection();
+ let (begin, end) = textinput.get_sorted_selection().unwrap();
assert_eq!(begin.index, 2);
assert_eq!(end.index, 4);
}