diff --git a/tests/unit/script/textinput.rs b/tests/unit/script/textinput.rs index 25ff3e827a0..75a49c824dc 100644 --- a/tests/unit/script/textinput.rs +++ b/tests/unit/script/textinput.rs @@ -20,6 +20,16 @@ fn text_input(lines: Lines, s: &str) -> TextInput { TextInput::new(lines, DOMString::from(s), DummyClipboardContext::new(""), None) } +#[test] +fn test_set_content_ignores_max_length() { + let mut textinput = TextInput::new( + Lines::Single, "".to_owned(), DummyClipboardContext::new(""), Some(1) + ); + + textinput.set_content("mozilla rocks".to_owned()); + assert_eq!(textinput.get_content(), "mozilla rocks".to_owned()); +} + #[test] fn test_textinput_when_inserting_multiple_lines_over_a_selection_respects_max_length() { let mut textinput = TextInput::new(