Skip to content

Commit

Permalink
Add @files checks in rustdoc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 23, 2023
1 parent 65a7047 commit 752fb52
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/rustdoc/files-creation-hidden.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 4 additions & 0 deletions tests/rustdoc/files-creation-private.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions tests/rustdoc/issue-111064-reexport-trait-from-hidden-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tests/rustdoc/issue-111249-file-creation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 752fb52

Please sign in to comment.