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