diff options
Diffstat (limited to 'crates/ra_assists/src/tests.rs')
-rw-r--r-- | crates/ra_assists/src/tests.rs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/crates/ra_assists/src/tests.rs b/crates/ra_assists/src/tests.rs index 9ba3da786..373a7f7cc 100644 --- a/crates/ra_assists/src/tests.rs +++ b/crates/ra_assists/src/tests.rs | |||
@@ -105,18 +105,9 @@ fn check(handler: Handler, before: &str, expected: ExpectedResult) { | |||
105 | change.edit.apply(&mut actual); | 105 | change.edit.apply(&mut actual); |
106 | 106 | ||
107 | if !source_change.is_snippet { | 107 | if !source_change.is_snippet { |
108 | match source_change.cursor_position { | 108 | if let Some(off) = source_change.cursor_position { |
109 | None => { | 109 | actual = add_cursor(&actual, off.offset) |
110 | if let RangeOrOffset::Offset(before_cursor_pos) = range_or_offset { | 110 | } |
111 | let off = change | ||
112 | .edit | ||
113 | .apply_to_offset(before_cursor_pos) | ||
114 | .expect("cursor position is affected by the edit"); | ||
115 | actual = add_cursor(&actual, off) | ||
116 | } | ||
117 | } | ||
118 | Some(off) => actual = add_cursor(&actual, off.offset), | ||
119 | }; | ||
120 | } | 111 | } |
121 | assert_eq_text!(after, &actual); | 112 | assert_eq_text!(after, &actual); |
122 | } | 113 | } |