diff options
Diffstat (limited to 'crates/ra_assists/src/add_derive.rs')
-rw-r--r-- | crates/ra_assists/src/add_derive.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/crates/ra_assists/src/add_derive.rs b/crates/ra_assists/src/add_derive.rs index de33b356c..ea9707631 100644 --- a/crates/ra_assists/src/add_derive.rs +++ b/crates/ra_assists/src/add_derive.rs | |||
@@ -39,7 +39,7 @@ fn derive_insertion_offset(nominal: &ast::NominalDef) -> Option<TextUnit> { | |||
39 | #[cfg(test)] | 39 | #[cfg(test)] |
40 | mod tests { | 40 | mod tests { |
41 | use super::*; | 41 | use super::*; |
42 | use crate::helpers::check_assist; | 42 | use crate::helpers::{check_assist, check_assist_target}; |
43 | 43 | ||
44 | #[test] | 44 | #[test] |
45 | fn add_derive_new() { | 45 | fn add_derive_new() { |
@@ -81,4 +81,21 @@ struct Foo { a: i32, } | |||
81 | ", | 81 | ", |
82 | ); | 82 | ); |
83 | } | 83 | } |
84 | |||
85 | #[test] | ||
86 | fn add_derive_target() { | ||
87 | check_assist_target( | ||
88 | add_derive, | ||
89 | " | ||
90 | struct SomeThingIrrelevant; | ||
91 | /// `Foo` is a pretty important struct. | ||
92 | /// It does stuff. | ||
93 | struct Foo { a: i32<|>, } | ||
94 | struct EvenMoreIrrelevant; | ||
95 | ", | ||
96 | "/// `Foo` is a pretty important struct. | ||
97 | /// It does stuff. | ||
98 | struct Foo { a: i32, }", | ||
99 | ); | ||
100 | } | ||
84 | } | 101 | } |