diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index c1e25575557bef78921841f1c2a9eb8e589085a2..808926ff50f3e71b157f6b8380980fc1bd109044 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -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. diff --git a/crates/editor/src/test.rs b/crates/editor/src/test.rs index d1316a85a0bf38afe5c39cb596b6647b89119252..0affe06f64b555890ea3b6289ec497ace6aeb18d 100644 --- a/crates/editor/src/test.rs +++ b/crates/editor/src/test.rs @@ -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> { diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs index b81714e0bc71474c753ee018b9fce161871f67f9..26c4fe01a8c54b54a080b54faf07a8b93bfa7b43 100644 --- a/crates/gpui/src/app.rs +++ b/crates/gpui/src/app.rs @@ -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 { diff --git a/crates/vim/src/vim_test_context.rs b/crates/vim/src/vim_test_context.rs index 57d0174703bbf5da9781c1f6f70f5bb23a9527d7..08ec4bd5e961315fa8c661ffbcfac89ab3a59207 100644 --- a/crates/vim/src/vim_test_context.rs +++ b/crates/vim/src/vim_test_context.rs @@ -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> {