From 147578f0fe28dee9ba3bfe3ed8805ffe3a525611 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 22 Aug 2018 18:05:43 +0300 Subject: add impl initial --- crates/libeditor/tests/test.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'crates/libeditor/tests/test.rs') 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}; use libeditor::{ ParsedFile, TextUnit, TextRange, ActionResult, highlight, runnables, extend_selection, file_structure, - flip_comma, add_derive, matching_brace, + flip_comma, add_derive, add_impl, matching_brace, }; #[test] @@ -144,6 +144,20 @@ fn test_add_derive() { ); } +#[test] +fn test_add_impl() { + check_action( + "struct Foo {<|>}\n", + "struct Foo {}\n\nimpl Foo {\n<|>\n}\n", + |file, off| add_impl(file, off).map(|f| f()), + ); + // check_action( + // "struct Foo {<|>}", + // "struct Foo {}\nimpl Foo {\n<|>\n}", + // |file, off| add_impl(file, off).map(|f| f()), + // ); +} + #[test] fn test_matching_brace() { fn do_check(before: &str, after: &str) { -- cgit v1.2.3