aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/assists/src/handlers/generate_default_from_enum_variant.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/assists/src/handlers/generate_default_from_enum_variant.rs b/crates/assists/src/handlers/generate_default_from_enum_variant.rs
index 5f6885710..bcea46735 100644
--- a/crates/assists/src/handlers/generate_default_from_enum_variant.rs
+++ b/crates/assists/src/handlers/generate_default_from_enum_variant.rs
@@ -105,7 +105,8 @@ mod tests {
105 fn test_generate_default_from_variant() { 105 fn test_generate_default_from_variant() {
106 check_assist( 106 check_assist(
107 generate_default_from_enum_variant, 107 generate_default_from_enum_variant,
108 r#"enum Variant { 108 r#"
109enum Variant {
109 Undefined, 110 Undefined,
110 Minor<|>, 111 Minor<|>,
111 Major, 112 Major,
@@ -128,7 +129,8 @@ impl Default for Variant {
128 fn test_generate_default_already_implemented() { 129 fn test_generate_default_already_implemented() {
129 mark::check!(test_gen_default_impl_already_exists); 130 mark::check!(test_gen_default_impl_already_exists);
130 check_not_applicable( 131 check_not_applicable(
131 r#"enum Variant { 132 r#"
133enum Variant {
132 Undefined, 134 Undefined,
133 Minor<|>, 135 Minor<|>,
134 Major, 136 Major,
@@ -146,7 +148,8 @@ impl Default for Variant {
146 fn test_add_from_impl_no_element() { 148 fn test_add_from_impl_no_element() {
147 mark::check!(test_gen_default_on_non_unit_variant_not_implemented); 149 mark::check!(test_gen_default_on_non_unit_variant_not_implemented);
148 check_not_applicable( 150 check_not_applicable(
149 r#"enum Variant { 151 r#"
152enum Variant {
150 Undefined, 153 Undefined,
151 Minor(u32)<|>, 154 Minor(u32)<|>,
152 Major, 155 Major,
@@ -159,7 +162,8 @@ impl Default for Variant {
159 check_assist( 162 check_assist(
160 generate_default_from_enum_variant, 163 generate_default_from_enum_variant,
161 r#"enum Variant { Undefi<|>ned }"#, 164 r#"enum Variant { Undefi<|>ned }"#,
162 r#"enum Variant { Undefined } 165 r#"
166enum Variant { Undefined }
163 167
164impl Default for Variant { 168impl Default for Variant {
165 fn default() -> Self { 169 fn default() -> Self {