Skip to content

Commit c0ad9b3

Browse files
Follow testing style guide
1 parent 6624158 commit c0ad9b3

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

crates/ide_assists/src/handlers/replace_derive_with_manual_impl.rs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ mod tests {
212212
fn add_custom_impl_debug() {
213213
check_assist(
214214
replace_derive_with_manual_impl,
215-
"
215+
r#"
216216
mod fmt {
217217
pub struct Error;
218218
pub type Result = Result<(), Error>;
@@ -226,8 +226,8 @@ mod fmt {
226226
struct Foo {
227227
bar: String,
228228
}
229-
",
230-
"
229+
"#,
230+
r#"
231231
mod fmt {
232232
pub struct Error;
233233
pub type Result = Result<(), Error>;
@@ -246,14 +246,14 @@ impl fmt::Debug for Foo {
246246
${0:todo!()}
247247
}
248248
}
249-
",
249+
"#,
250250
)
251251
}
252252
#[test]
253253
fn add_custom_impl_all() {
254254
check_assist(
255255
replace_derive_with_manual_impl,
256-
"
256+
r#"
257257
mod foo {
258258
pub trait Bar {
259259
type Qux;
@@ -268,8 +268,8 @@ mod foo {
268268
struct Foo {
269269
bar: String,
270270
}
271-
",
272-
"
271+
"#,
272+
r#"
273273
mod foo {
274274
pub trait Bar {
275275
type Qux;
@@ -295,110 +295,110 @@ impl foo::Bar for Foo {
295295
todo!()
296296
}
297297
}
298-
",
298+
"#,
299299
)
300300
}
301301
#[test]
302302
fn add_custom_impl_for_unique_input() {
303303
check_assist(
304304
replace_derive_with_manual_impl,
305-
"
305+
r#"
306306
#[derive(Debu$0g)]
307307
struct Foo {
308308
bar: String,
309309
}
310-
",
311-
"
310+
"#,
311+
r#"
312312
struct Foo {
313313
bar: String,
314314
}
315315
316316
impl Debug for Foo {
317317
$0
318318
}
319-
",
319+
"#,
320320
)
321321
}
322322

323323
#[test]
324324
fn add_custom_impl_for_with_visibility_modifier() {
325325
check_assist(
326326
replace_derive_with_manual_impl,
327-
"
327+
r#"
328328
#[derive(Debug$0)]
329329
pub struct Foo {
330330
bar: String,
331331
}
332-
",
333-
"
332+
"#,
333+
r#"
334334
pub struct Foo {
335335
bar: String,
336336
}
337337
338338
impl Debug for Foo {
339339
$0
340340
}
341-
",
341+
"#,
342342
)
343343
}
344344

345345
#[test]
346346
fn add_custom_impl_when_multiple_inputs() {
347347
check_assist(
348348
replace_derive_with_manual_impl,
349-
"
349+
r#"
350350
#[derive(Display, Debug$0, Serialize)]
351351
struct Foo {}
352-
",
353-
"
352+
"#,
353+
r#"
354354
#[derive(Display, Serialize)]
355355
struct Foo {}
356356
357357
impl Debug for Foo {
358358
$0
359359
}
360-
",
360+
"#,
361361
)
362362
}
363363

364364
#[test]
365365
fn test_ignore_derive_macro_without_input() {
366366
check_assist_not_applicable(
367367
replace_derive_with_manual_impl,
368-
"
368+
r#"
369369
#[derive($0)]
370370
struct Foo {}
371-
",
371+
"#,
372372
)
373373
}
374374

375375
#[test]
376376
fn test_ignore_if_cursor_on_param() {
377377
check_assist_not_applicable(
378378
replace_derive_with_manual_impl,
379-
"
379+
r#"
380380
#[derive$0(Debug)]
381381
struct Foo {}
382-
",
382+
"#,
383383
);
384384

385385
check_assist_not_applicable(
386386
replace_derive_with_manual_impl,
387-
"
387+
r#"
388388
#[derive(Debug)$0]
389389
struct Foo {}
390-
",
390+
"#,
391391
)
392392
}
393393

394394
#[test]
395395
fn test_ignore_if_not_derive() {
396396
check_assist_not_applicable(
397397
replace_derive_with_manual_impl,
398-
"
398+
r#"
399399
#[allow(non_camel_$0case_types)]
400400
struct Foo {}
401-
",
401+
"#,
402402
)
403403
}
404404

0 commit comments

Comments
 (0)