Fix test assertions

This commit is contained in:
Antonio Scandurra 2021-11-29 18:15:03 +01:00
parent 9d7039ed51
commit 1803bd77ef

View file

@ -589,7 +589,10 @@ mod tests {
editor.update(&mut cx, |editor, cx| {
assert!(!editor.is_dirty(cx.as_ref()));
assert_eq!(editor.title(cx.as_ref()), "untitled");
assert!(editor.language(cx).is_none());
assert!(Arc::ptr_eq(
editor.language(cx).unwrap(),
&language::PLAIN_TEXT
));
editor.handle_input(&editor::Input("hi".into()), cx);
assert!(editor.is_dirty(cx.as_ref()));
});
@ -683,7 +686,10 @@ mod tests {
});
editor.update(&mut cx, |editor, cx| {
assert!(editor.language(cx).is_none());
assert!(Arc::ptr_eq(
editor.language(cx).unwrap(),
&language::PLAIN_TEXT
));
editor.handle_input(&editor::Input("hi".into()), cx);
assert!(editor.is_dirty(cx.as_ref()));
});