diff options
author | Avi Weinstock <aweinstock314@gmail.com> | 2015-06-18 11:58:03 -0400 |
---|---|---|
committer | Avi Weinstock <aweinstock314@gmail.com> | 2015-07-29 12:19:37 -0400 |
commit | f86252a60bf9f4496fb010b5d1d3f9fc3648467f (patch) | |
tree | 73afbca5443fc2c0aa6677e15b9716212d8e4a3b /tests/unit/script/textinput.rs | |
parent | 52c2049f2a47c814888e98c509eac83dc071e829 (diff) | |
download | servo-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.rs | 4 |
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); } |