Add @files checks in rustdoc tests

This commit is contained in:
Guillaume Gomez 2023-06-23 15:12:13 +02:00
parent 65a7047ee4
commit 752fb52ae9
4 changed files with 17 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#![crate_name="foo"]
// @files foo '["index.html", "all.html", "sidebar-items.js"]'
// @!has "foo/struct.Foo.html"
#[doc(hidden)]
pub struct Foo;

View File

@ -1,5 +1,9 @@
#![crate_name="foo"]
// @files "foo" \
// '["index.html", "all.html", "sidebar-items.js", "foo", "bar", "private", "struct.Bar.html"]'
// @files "foo/bar" '["index.html", "sidebar-items.js"]'
// @!has "foo/priv/index.html"
// @!has "foo/priv/struct.Foo.html"
mod private {

View File

@ -2,6 +2,12 @@
#![no_core]
#![crate_name = "foo"]
// @files "foo" "['sidebar-items.js', 'all.html', 'hidden', 'index.html', 'struct.Bar.html', \
// 'visible']"
// @files "foo/hidden" "['inner']"
// @files "foo/hidden/inner" "['trait.Foo.html']"
// @files "foo/visible" "['index.html', 'sidebar-items.js', 'trait.Foo.html']"
// @!has 'foo/hidden/index.html'
// @!has 'foo/hidden/inner/index.html'
// FIXME: Should be `@!has`: https://github.com/rust-lang/rust/issues/111249

View File

@ -2,6 +2,12 @@
#![feature(no_core)]
#![no_core]
// @files "foo" "['all.html', 'visible', 'index.html', 'sidebar-items.js', 'hidden', \
// 'struct.Bar.html']"
// @files "foo/visible" "['trait.Foo.html', 'index.html', 'sidebar-items.js']"
// @files "foo/hidden" "['inner']"
// @files "foo/hidden/inner" "['trait.Foo.html']"
// The following five should not fail!
// @!has 'foo/hidden/index.html'
// @!has 'foo/hidden/inner/index.html'