diff options
Diffstat (limited to 'crates/ra_assists/src/change_visibility.rs')
-rw-r--r-- | crates/ra_assists/src/change_visibility.rs | 42 |
1 files changed, 7 insertions, 35 deletions
diff --git a/crates/ra_assists/src/change_visibility.rs b/crates/ra_assists/src/change_visibility.rs index 4cd32985e..fa5f231c8 100644 --- a/crates/ra_assists/src/change_visibility.rs +++ b/crates/ra_assists/src/change_visibility.rs | |||
@@ -81,31 +81,11 @@ mod tests { | |||
81 | 81 | ||
82 | #[test] | 82 | #[test] |
83 | fn change_visibility_adds_pub_crate_to_items() { | 83 | fn change_visibility_adds_pub_crate_to_items() { |
84 | check_assist( | 84 | check_assist(change_visibility, "<|>fn foo() {}", "<|>pub(crate) fn foo() {}"); |
85 | change_visibility, | 85 | check_assist(change_visibility, "f<|>n foo() {}", "<|>pub(crate) fn foo() {}"); |
86 | "<|>fn foo() {}", | 86 | check_assist(change_visibility, "<|>struct Foo {}", "<|>pub(crate) struct Foo {}"); |
87 | "<|>pub(crate) fn foo() {}", | 87 | check_assist(change_visibility, "<|>mod foo {}", "<|>pub(crate) mod foo {}"); |
88 | ); | 88 | check_assist(change_visibility, "<|>trait Foo {}", "<|>pub(crate) trait Foo {}"); |
89 | check_assist( | ||
90 | change_visibility, | ||
91 | "f<|>n foo() {}", | ||
92 | "<|>pub(crate) fn foo() {}", | ||
93 | ); | ||
94 | check_assist( | ||
95 | change_visibility, | ||
96 | "<|>struct Foo {}", | ||
97 | "<|>pub(crate) struct Foo {}", | ||
98 | ); | ||
99 | check_assist( | ||
100 | change_visibility, | ||
101 | "<|>mod foo {}", | ||
102 | "<|>pub(crate) mod foo {}", | ||
103 | ); | ||
104 | check_assist( | ||
105 | change_visibility, | ||
106 | "<|>trait Foo {}", | ||
107 | "<|>pub(crate) trait Foo {}", | ||
108 | ); | ||
109 | check_assist(change_visibility, "m<|>od {}", "<|>pub(crate) mod {}"); | 89 | check_assist(change_visibility, "m<|>od {}", "<|>pub(crate) mod {}"); |
110 | check_assist( | 90 | check_assist( |
111 | change_visibility, | 91 | change_visibility, |
@@ -125,20 +105,12 @@ mod tests { | |||
125 | 105 | ||
126 | #[test] | 106 | #[test] |
127 | fn change_visibility_pub_to_pub_crate() { | 107 | fn change_visibility_pub_to_pub_crate() { |
128 | check_assist( | 108 | check_assist(change_visibility, "<|>pub fn foo() {}", "<|>pub(crate) fn foo() {}") |
129 | change_visibility, | ||
130 | "<|>pub fn foo() {}", | ||
131 | "<|>pub(crate) fn foo() {}", | ||
132 | ) | ||
133 | } | 109 | } |
134 | 110 | ||
135 | #[test] | 111 | #[test] |
136 | fn change_visibility_pub_crate_to_pub() { | 112 | fn change_visibility_pub_crate_to_pub() { |
137 | check_assist( | 113 | check_assist(change_visibility, "<|>pub(crate) fn foo() {}", "<|>pub fn foo() {}") |
138 | change_visibility, | ||
139 | "<|>pub(crate) fn foo() {}", | ||
140 | "<|>pub fn foo() {}", | ||
141 | ) | ||
142 | } | 114 | } |
143 | 115 | ||
144 | #[test] | 116 | #[test] |