diff options
author | Aleksey Kladov <[email protected]> | 2019-10-25 21:38:15 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-10-25 21:38:15 +0100 |
commit | d385438bcc8d302fbcb91114e19ac0cc30528822 (patch) | |
tree | d57842c6462f4921976d6d9642ce7751681cf0bd /crates/ra_assists/src/doc_tests | |
parent | e6cb06d2850b9b9c38c0c13d6948ab39adcd652e (diff) |
generate more assists docs
Diffstat (limited to 'crates/ra_assists/src/doc_tests')
-rw-r--r-- | crates/ra_assists/src/doc_tests/generated.rs | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/crates/ra_assists/src/doc_tests/generated.rs b/crates/ra_assists/src/doc_tests/generated.rs index e5f6910f1..76d86b93d 100644 --- a/crates/ra_assists/src/doc_tests/generated.rs +++ b/crates/ra_assists/src/doc_tests/generated.rs | |||
@@ -3,6 +3,145 @@ | |||
3 | use super::check; | 3 | use super::check; |
4 | 4 | ||
5 | #[test] | 5 | #[test] |
6 | fn doctest_add_derive() { | ||
7 | check( | ||
8 | "add_derive", | ||
9 | r#####" | ||
10 | struct Point { | ||
11 | x: u32, | ||
12 | y: u32,<|> | ||
13 | } | ||
14 | "#####, | ||
15 | r#####" | ||
16 | #[derive()] | ||
17 | struct Point { | ||
18 | x: u32, | ||
19 | y: u32, | ||
20 | } | ||
21 | "#####, | ||
22 | ) | ||
23 | } | ||
24 | |||
25 | #[test] | ||
26 | fn doctest_add_explicit_type() { | ||
27 | check( | ||
28 | "add_explicit_type", | ||
29 | r#####" | ||
30 | fn main() { | ||
31 | let x<|> = 92; | ||
32 | } | ||
33 | "#####, | ||
34 | r#####" | ||
35 | fn main() { | ||
36 | let x: i32 = 92; | ||
37 | } | ||
38 | "#####, | ||
39 | ) | ||
40 | } | ||
41 | |||
42 | #[test] | ||
43 | fn doctest_add_impl() { | ||
44 | check( | ||
45 | "add_impl", | ||
46 | r#####" | ||
47 | struct Ctx<T: Clone> { | ||
48 | data: T,<|> | ||
49 | } | ||
50 | "#####, | ||
51 | r#####" | ||
52 | struct Ctx<T: Clone> { | ||
53 | data: T, | ||
54 | } | ||
55 | |||
56 | impl<T: Clone> Ctx<T> { | ||
57 | |||
58 | } | ||
59 | "#####, | ||
60 | ) | ||
61 | } | ||
62 | |||
63 | #[test] | ||
64 | fn doctest_add_impl_default_members() { | ||
65 | check( | ||
66 | "add_impl_default_members", | ||
67 | r#####" | ||
68 | trait T { | ||
69 | Type X; | ||
70 | fn foo(&self); | ||
71 | fn bar(&self) {} | ||
72 | } | ||
73 | |||
74 | impl T for () { | ||
75 | Type X = (); | ||
76 | fn foo(&self) {}<|> | ||
77 | |||
78 | } | ||
79 | "#####, | ||
80 | r#####" | ||
81 | trait T { | ||
82 | Type X; | ||
83 | fn foo(&self); | ||
84 | fn bar(&self) {} | ||
85 | } | ||
86 | |||
87 | impl T for () { | ||
88 | Type X = (); | ||
89 | fn foo(&self) {} | ||
90 | fn bar(&self) {} | ||
91 | |||
92 | } | ||
93 | "#####, | ||
94 | ) | ||
95 | } | ||
96 | |||
97 | #[test] | ||
98 | fn doctest_add_impl_missing_members() { | ||
99 | check( | ||
100 | "add_impl_missing_members", | ||
101 | r#####" | ||
102 | trait T { | ||
103 | Type X; | ||
104 | fn foo(&self); | ||
105 | fn bar(&self) {} | ||
106 | } | ||
107 | |||
108 | impl T for () {<|> | ||
109 | |||
110 | } | ||
111 | "#####, | ||
112 | r#####" | ||
113 | trait T { | ||
114 | Type X; | ||
115 | fn foo(&self); | ||
116 | fn bar(&self) {} | ||
117 | } | ||
118 | |||
119 | impl T for () { | ||
120 | fn foo(&self) { unimplemented!() } | ||
121 | |||
122 | } | ||
123 | "#####, | ||
124 | ) | ||
125 | } | ||
126 | |||
127 | #[test] | ||
128 | fn doctest_apply_demorgan() { | ||
129 | check( | ||
130 | "apply_demorgan", | ||
131 | r#####" | ||
132 | fn main() { | ||
133 | if x != 4 ||<|> !y {} | ||
134 | } | ||
135 | "#####, | ||
136 | r#####" | ||
137 | fn main() { | ||
138 | if !(x == 4 && y) {} | ||
139 | } | ||
140 | "#####, | ||
141 | ) | ||
142 | } | ||
143 | |||
144 | #[test] | ||
6 | fn doctest_convert_to_guarded_return() { | 145 | fn doctest_convert_to_guarded_return() { |
7 | check( | 146 | check( |
8 | "convert_to_guarded_return", | 147 | "convert_to_guarded_return", |