Generate doctest

This commit is contained in:
unexge 2020-08-02 23:07:56 +03:00
parent a05a2ab1bb
commit 544322e66a
2 changed files with 28 additions and 1 deletions

View file

@ -31,7 +31,7 @@ use crate::{
// pub struct Baz; // pub struct Baz;
// } // }
// //
// use foo::{Bar, Baz}; // use foo::{Baz, Bar};
// //
// fn qux(bar: Bar, baz: Baz) {} // fn qux(bar: Bar, baz: Baz) {}
// ``` // ```

View file

@ -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] #[test]
fn doctest_extract_struct_from_enum_variant() { fn doctest_extract_struct_from_enum_variant() {
check_doc_test( check_doc_test(