mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Adds a test for set_content to ignore max_length
This commit is contained in:
parent
eecdfdf6c1
commit
419a26e619
1 changed files with 10 additions and 0 deletions
|
@ -20,6 +20,16 @@ fn text_input(lines: Lines, s: &str) -> TextInput<DummyClipboardContext> {
|
|||
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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue