mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 05:08:52 +00:00
Generate doctest
This commit is contained in:
parent
a05a2ab1bb
commit
544322e66a
2 changed files with 28 additions and 1 deletions
|
@ -31,7 +31,7 @@ use crate::{
|
|||
// pub struct Baz;
|
||||
// }
|
||||
//
|
||||
// use foo::{Bar, Baz};
|
||||
// use foo::{Baz, Bar};
|
||||
//
|
||||
// fn qux(bar: Bar, baz: Baz) {}
|
||||
// ```
|
||||
|
|
|
@ -228,6 +228,33 @@ fn main() {
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn doctest_expand_glob_import() {
|
||||
check_doc_test(
|
||||
"expand_glob_import",
|
||||
r#####"
|
||||
mod foo {
|
||||
pub struct Bar;
|
||||
pub struct Baz;
|
||||
}
|
||||
|
||||
use foo::*<|>;
|
||||
|
||||
fn qux(bar: Bar, baz: Baz) {}
|
||||
"#####,
|
||||
r#####"
|
||||
mod foo {
|
||||
pub struct Bar;
|
||||
pub struct Baz;
|
||||
}
|
||||
|
||||
use foo::{Baz, Bar};
|
||||
|
||||
fn qux(bar: Bar, baz: Baz) {}
|
||||
"#####,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn doctest_extract_struct_from_enum_variant() {
|
||||
check_doc_test(
|
||||
|
|
Loading…
Reference in a new issue