aboutsummaryrefslogtreecommitdiff
path: root/crates/libeditor/tests/test.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-17 17:54:08 +0100
committerAleksey Kladov <[email protected]>2018-08-17 17:54:08 +0100
commited7ae78c6fd9e508f6e959c6a164cf8481f6b377 (patch)
tree556e8d4daffefa64dcdc5db8e75299514a0e85e4 /crates/libeditor/tests/test.rs
parent41570f60bf268c97223a864b8aa11a339929f55a (diff)
ServerWorld
Diffstat (limited to 'crates/libeditor/tests/test.rs')
-rw-r--r--crates/libeditor/tests/test.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/libeditor/tests/test.rs b/crates/libeditor/tests/test.rs
index df4cb65d1..cc4226710 100644
--- a/crates/libeditor/tests/test.rs
+++ b/crates/libeditor/tests/test.rs
@@ -1,11 +1,8 @@
1extern crate libeditor; 1extern crate libeditor;
2extern crate libsyntax2; 2extern crate libsyntax2;
3extern crate itertools;
4#[macro_use] 3#[macro_use]
5extern crate assert_eq_text; 4extern crate assert_eq_text;
6 5
7use std::fmt;
8use itertools::Itertools;
9use assert_eq_text::{assert_eq_dbg}; 6use assert_eq_text::{assert_eq_dbg};
10use libeditor::{ 7use libeditor::{
11 File, TextUnit, TextRange, ActionResult, CursorPosition, 8 File, TextUnit, TextRange, ActionResult, CursorPosition,
@@ -119,6 +116,11 @@ fn test_add_derive() {
119 |file, off| add_derive(file, off).map(|f| f()), 116 |file, off| add_derive(file, off).map(|f| f()),
120 ); 117 );
121 check_action( 118 check_action(
119 "struct Foo { <|> a: i32, }",
120 "#[derive(<|>)]\nstruct Foo { a: i32, }",
121 |file, off| add_derive(file, off).map(|f| f()),
122 );
123 check_action(
122 "#[derive(Clone)]\nstruct Foo { a: i32<|>, }", 124 "#[derive(Clone)]\nstruct Foo { a: i32<|>, }",
123 "#[derive(Clone<|>)]\nstruct Foo { a: i32, }", 125 "#[derive(Clone<|>)]\nstruct Foo { a: i32, }",
124 |file, off| add_derive(file, off).map(|f| f()), 126 |file, off| add_derive(file, off).map(|f| f()),