Add rustdoc tests for lazy_type_alias
This commit is contained in:
parent
60ec8405eb
commit
1af48beed7
4 changed files with 49 additions and 0 deletions
18
tests/rustdoc/alias-reexport.rs
Normal file
18
tests/rustdoc/alias-reexport.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
// aux-build:alias-reexport.rs
|
||||
// aux-build:alias-reexport2.rs
|
||||
|
||||
#![crate_name = "foo"]
|
||||
#![feature(lazy_type_alias)]
|
||||
|
||||
extern crate alias_reexport2;
|
||||
|
||||
// @has 'foo/reexport/fn.foo.html'
|
||||
// FIXME: should be 'pub fn foo() -> Reexport'
|
||||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> u8'
|
||||
// @has 'foo/reexport/fn.foo2.html'
|
||||
// FIXME: should be 'pub fn foo2() -> Result<Reexport, ()>'
|
||||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<u8, ()>'
|
||||
// @has 'foo/reexport/type.Reexported.html'
|
||||
// @has - '//*[@class="rust item-decl"]' 'pub type Reexported = u8;'
|
||||
#[doc(inline)]
|
||||
pub use alias_reexport2 as reexport;
|
16
tests/rustdoc/alias-reexport2.rs
Normal file
16
tests/rustdoc/alias-reexport2.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
// gate-test-lazy_type_alias
|
||||
// aux-build:alias-reexport.rs
|
||||
|
||||
#![crate_name = "foo"]
|
||||
#![feature(lazy_type_alias)]
|
||||
|
||||
extern crate alias_reexport;
|
||||
|
||||
use alias_reexport::Reexported;
|
||||
|
||||
// @has 'foo/fn.foo.html'
|
||||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported'
|
||||
pub fn foo() -> Reexported { 0 }
|
||||
// @has 'foo/fn.foo2.html'
|
||||
// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
|
||||
pub fn foo2() -> Result<Reexported, ()> { Ok(0) }
|
3
tests/rustdoc/auxiliary/alias-reexport.rs
Normal file
3
tests/rustdoc/auxiliary/alias-reexport.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
#![feature(lazy_type_alias)]
|
||||
|
||||
pub type Reexported = u8;
|
12
tests/rustdoc/auxiliary/alias-reexport2.rs
Normal file
12
tests/rustdoc/auxiliary/alias-reexport2.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
#![feature(lazy_type_alias)]
|
||||
|
||||
extern crate alias_reexport;
|
||||
|
||||
pub use alias_reexport::Reexported;
|
||||
|
||||
// @has 'foo/fn.foo.html'
|
||||
// @has - '//*[@class="docblock item-decl"]' 'pub fn foo() -> Reexported'
|
||||
pub fn foo() -> Reexported { 0 }
|
||||
// @has 'foo/fn.foo2.html'
|
||||
// @has - '//*[@class="docblock item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
|
||||
pub fn foo2() -> Result<Reexported, ()> { Ok(0) }
|
Loading…
Add table
Reference in a new issue