From 40adb9aeab84f1d1e757af838a4210f6e7b57292 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 9 Mar 2021 21:33:39 +0100 Subject: [PATCH] Add test to ensure the attributes position when js is disabled --- src/test/rustdoc-gui/lib.rs | 5 +++++ src/test/rustdoc-gui/nojs-attr-pos.goml | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 src/test/rustdoc-gui/nojs-attr-pos.goml diff --git a/src/test/rustdoc-gui/lib.rs b/src/test/rustdoc-gui/lib.rs index 3c996f5b65c..15d8dcc6e84 100644 --- a/src/test/rustdoc-gui/lib.rs +++ b/src/test/rustdoc-gui/lib.rs @@ -27,6 +27,11 @@ pub fn foo() {} /// Just a normal struct. pub struct Foo; +impl Foo { + #[must_use] + pub fn must_use(&self) -> bool { true } +} + /// Just a normal enum. pub enum WhoLetTheDogOut { /// Woof! diff --git a/src/test/rustdoc-gui/nojs-attr-pos.goml b/src/test/rustdoc-gui/nojs-attr-pos.goml new file mode 100644 index 00000000000..35daa4cb9e3 --- /dev/null +++ b/src/test/rustdoc-gui/nojs-attr-pos.goml @@ -0,0 +1,5 @@ +// Check that the attributes are well positioned when javascript is disabled (since +// there is no toggle to display) +javascript: false +goto: file://|DOC_PATH|/struct.Foo.html +assert: (".attributes", {"margin-left": "0px"})