aboutsummaryrefslogtreecommitdiff
path: root/crates/libeditor/tests/test.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libeditor/tests/test.rs')
-rw-r--r--crates/libeditor/tests/test.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/crates/libeditor/tests/test.rs b/crates/libeditor/tests/test.rs
index 4f4b4b773..3b0ec78eb 100644
--- a/crates/libeditor/tests/test.rs
+++ b/crates/libeditor/tests/test.rs
@@ -7,7 +7,7 @@ use assert_eq_text::{assert_eq_dbg};
7use libeditor::{ 7use libeditor::{
8 ParsedFile, TextUnit, TextRange, ActionResult, 8 ParsedFile, TextUnit, TextRange, ActionResult,
9 highlight, runnables, extend_selection, file_structure, 9 highlight, runnables, extend_selection, file_structure,
10 flip_comma, add_derive, matching_brace, 10 flip_comma, add_derive, add_impl, matching_brace,
11}; 11};
12 12
13#[test] 13#[test]
@@ -145,6 +145,20 @@ fn test_add_derive() {
145} 145}
146 146
147#[test] 147#[test]
148fn test_add_impl() {
149 check_action(
150 "struct Foo {<|>}\n",
151 "struct Foo {}\n\nimpl Foo {\n<|>\n}\n",
152 |file, off| add_impl(file, off).map(|f| f()),
153 );
154 // check_action(
155 // "struct Foo<T: Clone> {<|>}",
156 // "struct Foo<T: Clone> {}\nimpl<T: Clone> Foo<T> {\n<|>\n}",
157 // |file, off| add_impl(file, off).map(|f| f()),
158 // );
159}
160
161#[test]
148fn test_matching_brace() { 162fn test_matching_brace() {
149 fn do_check(before: &str, after: &str) { 163 fn do_check(before: &str, after: &str) {
150 let (pos, before) = extract_cursor(before); 164 let (pos, before) = extract_cursor(before);