Change summary
crates/editor/src/editor.rs | 2 +-
crates/editor/src/test.rs | 8 --------
crates/gpui/src/app.rs | 8 ++++++++
crates/vim/src/vim_test_context.rs | 8 --------
4 files changed, 9 insertions(+), 17 deletions(-)
Detailed changes
@@ -8232,7 +8232,7 @@ mod tests {
fox ju|mps over
the lazy dog"});
cx.update_editor(|e, cx| e.copy(&Copy, cx));
- cx.assert_clipboard_content(Some("fox jumps over\n"));
+ cx.cx.assert_clipboard_content(Some("fox jumps over\n"));
// Paste with three selections, noticing how the copied full-line selection is inserted
// before the empty selections but replaces the selection that is non-empty.
@@ -404,14 +404,6 @@ impl<'a> EditorTestContext<'a> {
editor_text_with_selections
}
-
- pub fn assert_clipboard_content(&mut self, expected_content: Option<&str>) {
- self.cx.update(|cx| {
- let actual_content = cx.read_from_clipboard().map(|item| item.text().to_owned());
- let expected_content = expected_content.map(|content| content.to_owned());
- assert_eq!(actual_content, expected_content);
- })
- }
}
impl<'a> Deref for EditorTestContext<'a> {
@@ -627,6 +627,14 @@ impl TestAppContext {
}
})
}
+
+ pub fn assert_clipboard_content(&mut self, expected_content: Option<&str>) {
+ self.update(|cx| {
+ let actual_content = cx.read_from_clipboard().map(|item| item.text().to_owned());
+ let expected_content = expected_content.map(|content| content.to_owned());
+ assert_eq!(actual_content, expected_content);
+ })
+ }
}
impl AsyncAppContext {
@@ -147,14 +147,6 @@ impl<'a> VimTestContext<'a> {
let mode = self.mode();
VimBindingTestContext::new(keystrokes, mode, mode, self)
}
-
- pub fn assert_clipboard_content(&mut self, expected_content: Option<&str>) {
- self.cx.update(|cx| {
- let actual_content = cx.read_from_clipboard().map(|item| item.text().to_owned());
- let expected_content = expected_content.map(|content| content.to_owned());
- assert_eq!(actual_content, expected_content);
- })
- }
}
impl<'a> Deref for VimTestContext<'a> {