diff options
author | unexge <[email protected]> | 2020-08-02 21:07:56 +0100 |
---|---|---|
committer | unexge <[email protected]> | 2020-08-02 21:07:56 +0100 |
commit | 544322e66aacb763f8c824b5a572f8d7b93c9a6f (patch) | |
tree | c0af796187f40b2065c6f4aedc09b709bc35807b /crates | |
parent | a05a2ab1bb942c7b950f270ff1a31ba67518ae14 (diff) |
Generate doctest
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_assists/src/handlers/expand_glob_import.rs | 2 | ||||
-rw-r--r-- | crates/ra_assists/src/tests/generated.rs | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/crates/ra_assists/src/handlers/expand_glob_import.rs b/crates/ra_assists/src/handlers/expand_glob_import.rs index ae9e86181..963c1353f 100644 --- a/crates/ra_assists/src/handlers/expand_glob_import.rs +++ b/crates/ra_assists/src/handlers/expand_glob_import.rs | |||
@@ -31,7 +31,7 @@ use crate::{ | |||
31 | // pub struct Baz; | 31 | // pub struct Baz; |
32 | // } | 32 | // } |
33 | // | 33 | // |
34 | // use foo::{Bar, Baz}; | 34 | // use foo::{Baz, Bar}; |
35 | // | 35 | // |
36 | // fn qux(bar: Bar, baz: Baz) {} | 36 | // fn qux(bar: Bar, baz: Baz) {} |
37 | // ``` | 37 | // ``` |
diff --git a/crates/ra_assists/src/tests/generated.rs b/crates/ra_assists/src/tests/generated.rs index eff7feded..97978e7a2 100644 --- a/crates/ra_assists/src/tests/generated.rs +++ b/crates/ra_assists/src/tests/generated.rs | |||
@@ -229,6 +229,33 @@ fn main() { | |||
229 | } | 229 | } |
230 | 230 | ||
231 | #[test] | 231 | #[test] |
232 | fn doctest_expand_glob_import() { | ||
233 | check_doc_test( | ||
234 | "expand_glob_import", | ||
235 | r#####" | ||
236 | mod foo { | ||
237 | pub struct Bar; | ||
238 | pub struct Baz; | ||
239 | } | ||
240 | |||
241 | use foo::*<|>; | ||
242 | |||
243 | fn qux(bar: Bar, baz: Baz) {} | ||
244 | "#####, | ||
245 | r#####" | ||
246 | mod foo { | ||
247 | pub struct Bar; | ||
248 | pub struct Baz; | ||
249 | } | ||
250 | |||
251 | use foo::{Baz, Bar}; | ||
252 | |||
253 | fn qux(bar: Bar, baz: Baz) {} | ||
254 | "#####, | ||
255 | ) | ||
256 | } | ||
257 | |||
258 | #[test] | ||
232 | fn doctest_extract_struct_from_enum_variant() { | 259 | fn doctest_extract_struct_from_enum_variant() { |
233 | check_doc_test( | 260 | check_doc_test( |
234 | "extract_struct_from_enum_variant", | 261 | "extract_struct_from_enum_variant", |