diff options
author | Zac Pullar-Strecker <[email protected]> | 2020-07-31 03:12:44 +0100 |
---|---|---|
committer | Zac Pullar-Strecker <[email protected]> | 2020-07-31 03:12:44 +0100 |
commit | f05d7b41a719d848844b054a16477b29d0f063c6 (patch) | |
tree | 0a8a0946e8aef2ce64d4c13d0035ba41cce2daf3 /crates/ra_assists/src/tests | |
parent | 73ff610e41959e3e7c78a2b4b25b086883132956 (diff) | |
parent | 6b7cb8b5ab539fc4333ce34bc29bf77c976f232a (diff) |
Merge remote-tracking branch 'upstream/master' into 503-hover-doc-links
Hasn't fixed tests yet.
Diffstat (limited to 'crates/ra_assists/src/tests')
-rw-r--r-- | crates/ra_assists/src/tests/generated.rs | 218 |
1 files changed, 109 insertions, 109 deletions
diff --git a/crates/ra_assists/src/tests/generated.rs b/crates/ra_assists/src/tests/generated.rs index 31ea888c5..eff7feded 100644 --- a/crates/ra_assists/src/tests/generated.rs +++ b/crates/ra_assists/src/tests/generated.rs | |||
@@ -22,26 +22,6 @@ impl Debug for S { | |||
22 | } | 22 | } |
23 | 23 | ||
24 | #[test] | 24 | #[test] |
25 | fn doctest_add_derive() { | ||
26 | check_doc_test( | ||
27 | "add_derive", | ||
28 | r#####" | ||
29 | struct Point { | ||
30 | x: u32, | ||
31 | y: u32,<|> | ||
32 | } | ||
33 | "#####, | ||
34 | r#####" | ||
35 | #[derive($0)] | ||
36 | struct Point { | ||
37 | x: u32, | ||
38 | y: u32, | ||
39 | } | ||
40 | "#####, | ||
41 | ) | ||
42 | } | ||
43 | |||
44 | #[test] | ||
45 | fn doctest_add_explicit_type() { | 25 | fn doctest_add_explicit_type() { |
46 | check_doc_test( | 26 | check_doc_test( |
47 | "add_explicit_type", | 27 | "add_explicit_type", |
@@ -59,52 +39,6 @@ fn main() { | |||
59 | } | 39 | } |
60 | 40 | ||
61 | #[test] | 41 | #[test] |
62 | fn doctest_add_from_impl_for_enum() { | ||
63 | check_doc_test( | ||
64 | "add_from_impl_for_enum", | ||
65 | r#####" | ||
66 | enum A { <|>One(u32) } | ||
67 | "#####, | ||
68 | r#####" | ||
69 | enum A { One(u32) } | ||
70 | |||
71 | impl From<u32> for A { | ||
72 | fn from(v: u32) -> Self { | ||
73 | A::One(v) | ||
74 | } | ||
75 | } | ||
76 | "#####, | ||
77 | ) | ||
78 | } | ||
79 | |||
80 | #[test] | ||
81 | fn doctest_add_function() { | ||
82 | check_doc_test( | ||
83 | "add_function", | ||
84 | r#####" | ||
85 | struct Baz; | ||
86 | fn baz() -> Baz { Baz } | ||
87 | fn foo() { | ||
88 | bar<|>("", baz()); | ||
89 | } | ||
90 | |||
91 | "#####, | ||
92 | r#####" | ||
93 | struct Baz; | ||
94 | fn baz() -> Baz { Baz } | ||
95 | fn foo() { | ||
96 | bar("", baz()); | ||
97 | } | ||
98 | |||
99 | fn bar(arg: &str, baz: Baz) { | ||
100 | ${0:todo!()} | ||
101 | } | ||
102 | |||
103 | "#####, | ||
104 | ) | ||
105 | } | ||
106 | |||
107 | #[test] | ||
108 | fn doctest_add_hash() { | 42 | fn doctest_add_hash() { |
109 | check_doc_test( | 43 | check_doc_test( |
110 | "add_hash", | 44 | "add_hash", |
@@ -122,27 +56,6 @@ fn main() { | |||
122 | } | 56 | } |
123 | 57 | ||
124 | #[test] | 58 | #[test] |
125 | fn doctest_add_impl() { | ||
126 | check_doc_test( | ||
127 | "add_impl", | ||
128 | r#####" | ||
129 | struct Ctx<T: Clone> { | ||
130 | data: T,<|> | ||
131 | } | ||
132 | "#####, | ||
133 | r#####" | ||
134 | struct Ctx<T: Clone> { | ||
135 | data: T, | ||
136 | } | ||
137 | |||
138 | impl<T: Clone> Ctx<T> { | ||
139 | $0 | ||
140 | } | ||
141 | "#####, | ||
142 | ) | ||
143 | } | ||
144 | |||
145 | #[test] | ||
146 | fn doctest_add_impl_default_members() { | 59 | fn doctest_add_impl_default_members() { |
147 | check_doc_test( | 60 | check_doc_test( |
148 | "add_impl_default_members", | 61 | "add_impl_default_members", |
@@ -209,28 +122,6 @@ impl Trait<u32> for () { | |||
209 | } | 122 | } |
210 | 123 | ||
211 | #[test] | 124 | #[test] |
212 | fn doctest_add_new() { | ||
213 | check_doc_test( | ||
214 | "add_new", | ||
215 | r#####" | ||
216 | struct Ctx<T: Clone> { | ||
217 | data: T,<|> | ||
218 | } | ||
219 | "#####, | ||
220 | r#####" | ||
221 | struct Ctx<T: Clone> { | ||
222 | data: T, | ||
223 | } | ||
224 | |||
225 | impl<T: Clone> Ctx<T> { | ||
226 | fn $0new(data: T) -> Self { Self { data } } | ||
227 | } | ||
228 | |||
229 | "#####, | ||
230 | ) | ||
231 | } | ||
232 | |||
233 | #[test] | ||
234 | fn doctest_add_turbo_fish() { | 125 | fn doctest_add_turbo_fish() { |
235 | check_doc_test( | 126 | check_doc_test( |
236 | "add_turbo_fish", | 127 | "add_turbo_fish", |
@@ -467,6 +358,115 @@ fn foo<T: Copy + Clone>() { } | |||
467 | } | 358 | } |
468 | 359 | ||
469 | #[test] | 360 | #[test] |
361 | fn doctest_generate_derive() { | ||
362 | check_doc_test( | ||
363 | "generate_derive", | ||
364 | r#####" | ||
365 | struct Point { | ||
366 | x: u32, | ||
367 | y: u32,<|> | ||
368 | } | ||
369 | "#####, | ||
370 | r#####" | ||
371 | #[derive($0)] | ||
372 | struct Point { | ||
373 | x: u32, | ||
374 | y: u32, | ||
375 | } | ||
376 | "#####, | ||
377 | ) | ||
378 | } | ||
379 | |||
380 | #[test] | ||
381 | fn doctest_generate_from_impl_for_enum() { | ||
382 | check_doc_test( | ||
383 | "generate_from_impl_for_enum", | ||
384 | r#####" | ||
385 | enum A { <|>One(u32) } | ||
386 | "#####, | ||
387 | r#####" | ||
388 | enum A { One(u32) } | ||
389 | |||
390 | impl From<u32> for A { | ||
391 | fn from(v: u32) -> Self { | ||
392 | A::One(v) | ||
393 | } | ||
394 | } | ||
395 | "#####, | ||
396 | ) | ||
397 | } | ||
398 | |||
399 | #[test] | ||
400 | fn doctest_generate_function() { | ||
401 | check_doc_test( | ||
402 | "generate_function", | ||
403 | r#####" | ||
404 | struct Baz; | ||
405 | fn baz() -> Baz { Baz } | ||
406 | fn foo() { | ||
407 | bar<|>("", baz()); | ||
408 | } | ||
409 | |||
410 | "#####, | ||
411 | r#####" | ||
412 | struct Baz; | ||
413 | fn baz() -> Baz { Baz } | ||
414 | fn foo() { | ||
415 | bar("", baz()); | ||
416 | } | ||
417 | |||
418 | fn bar(arg: &str, baz: Baz) { | ||
419 | ${0:todo!()} | ||
420 | } | ||
421 | |||
422 | "#####, | ||
423 | ) | ||
424 | } | ||
425 | |||
426 | #[test] | ||
427 | fn doctest_generate_impl() { | ||
428 | check_doc_test( | ||
429 | "generate_impl", | ||
430 | r#####" | ||
431 | struct Ctx<T: Clone> { | ||
432 | data: T,<|> | ||
433 | } | ||
434 | "#####, | ||
435 | r#####" | ||
436 | struct Ctx<T: Clone> { | ||
437 | data: T, | ||
438 | } | ||
439 | |||
440 | impl<T: Clone> Ctx<T> { | ||
441 | $0 | ||
442 | } | ||
443 | "#####, | ||
444 | ) | ||
445 | } | ||
446 | |||
447 | #[test] | ||
448 | fn doctest_generate_new() { | ||
449 | check_doc_test( | ||
450 | "generate_new", | ||
451 | r#####" | ||
452 | struct Ctx<T: Clone> { | ||
453 | data: T,<|> | ||
454 | } | ||
455 | "#####, | ||
456 | r#####" | ||
457 | struct Ctx<T: Clone> { | ||
458 | data: T, | ||
459 | } | ||
460 | |||
461 | impl<T: Clone> Ctx<T> { | ||
462 | fn $0new(data: T) -> Self { Self { data } } | ||
463 | } | ||
464 | |||
465 | "#####, | ||
466 | ) | ||
467 | } | ||
468 | |||
469 | #[test] | ||
470 | fn doctest_inline_local_variable() { | 470 | fn doctest_inline_local_variable() { |
471 | check_doc_test( | 471 | check_doc_test( |
472 | "inline_local_variable", | 472 | "inline_local_variable", |