diff --git a/tests/rustdoc/alias-reexport.rs b/tests/rustdoc/alias-reexport.rs index 0f77d8b3f96..41f1f8df0f6 100644 --- a/tests/rustdoc/alias-reexport.rs +++ b/tests/rustdoc/alias-reexport.rs @@ -7,11 +7,11 @@ extern crate alias_reexport2; -// @has 'foo/reexport/fn.foo.html' -// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported' -// @has 'foo/reexport/fn.foo2.html' -// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result' -// @has 'foo/reexport/type.Reexported.html' -// @has - '//*[@class="rust item-decl"]' 'pub type Reexported = u8;' +//@ has 'foo/reexport/fn.foo.html' +//@ has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported' +//@ has 'foo/reexport/fn.foo2.html' +//@ has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result' +//@ has 'foo/reexport/type.Reexported.html' +//@ has - '//*[@class="rust item-decl"]' 'pub type Reexported = u8;' #[doc(inline)] pub use alias_reexport2 as reexport; diff --git a/tests/rustdoc/alias-reexport2.rs b/tests/rustdoc/alias-reexport2.rs index 60b7a5f9b83..2fb69b922c8 100644 --- a/tests/rustdoc/alias-reexport2.rs +++ b/tests/rustdoc/alias-reexport2.rs @@ -9,9 +9,9 @@ extern crate alias_reexport; use alias_reexport::Reexported; -// @has 'foo/fn.foo.html' -// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> 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' +//@ has 'foo/fn.foo2.html' +//@ has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result' pub fn foo2() -> Result { Ok(0) } diff --git a/tests/rustdoc/all.rs b/tests/rustdoc/all.rs index 4c8d0231095..7056af8e343 100644 --- a/tests/rustdoc/all.rs +++ b/tests/rustdoc/all.rs @@ -1,11 +1,11 @@ #![crate_name = "foo"] -// @has foo/all.html '//a[@href="struct.Struct.html"]' 'Struct' -// @has foo/all.html '//a[@href="enum.Enum.html"]' 'Enum' -// @has foo/all.html '//a[@href="union.Union.html"]' 'Union' -// @has foo/all.html '//a[@href="constant.CONST.html"]' 'CONST' -// @has foo/all.html '//a[@href="static.STATIC.html"]' 'STATIC' -// @has foo/all.html '//a[@href="fn.function.html"]' 'function' +//@ has foo/all.html '//a[@href="struct.Struct.html"]' 'Struct' +//@ has foo/all.html '//a[@href="enum.Enum.html"]' 'Enum' +//@ has foo/all.html '//a[@href="union.Union.html"]' 'Union' +//@ has foo/all.html '//a[@href="constant.CONST.html"]' 'CONST' +//@ has foo/all.html '//a[@href="static.STATIC.html"]' 'STATIC' +//@ has foo/all.html '//a[@href="fn.function.html"]' 'function' pub struct Struct; pub enum Enum { @@ -23,6 +23,6 @@ mod private_module { pub struct ReexportedStruct; } -// @has foo/all.html '//a[@href="struct.ReexportedStruct.html"]' 'ReexportedStruct' -// @!hasraw foo/all.html 'private_module' +//@ has foo/all.html '//a[@href="struct.ReexportedStruct.html"]' 'ReexportedStruct' +//@ !hasraw foo/all.html 'private_module' pub use private_module::ReexportedStruct; diff --git a/tests/rustdoc/anchor-id-duplicate-method-name-25001.rs b/tests/rustdoc/anchor-id-duplicate-method-name-25001.rs index ffb0765d3c3..5fa6891b23d 100644 --- a/tests/rustdoc/anchor-id-duplicate-method-name-25001.rs +++ b/tests/rustdoc/anchor-id-duplicate-method-name-25001.rs @@ -1,7 +1,7 @@ // https://github.com/rust-lang/rust/issues/25001 #![crate_name="issue_25001"] -// @has issue_25001/struct.Foo.html +//@ has issue_25001/struct.Foo.html pub struct Foo(T); pub trait Bar { @@ -11,36 +11,36 @@ pub trait Bar { } impl Foo { - // @has - '//*[@id="method.pass"]//h4[@class="code-header"]' 'fn pass()' + //@ has - '//*[@id="method.pass"]//h4[@class="code-header"]' 'fn pass()' pub fn pass() {} } impl Foo { - // @has - '//*[@id="method.pass-1"]//h4[@class="code-header"]' 'fn pass() -> usize' + //@ has - '//*[@id="method.pass-1"]//h4[@class="code-header"]' 'fn pass() -> usize' pub fn pass() -> usize { 42 } } impl Foo { - // @has - '//*[@id="method.pass-2"]//h4[@class="code-header"]' 'fn pass() -> isize' + //@ has - '//*[@id="method.pass-2"]//h4[@class="code-header"]' 'fn pass() -> isize' pub fn pass() -> isize { 42 } } impl Bar for Foo { - // @has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' 'type Item = T' + //@ has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' 'type Item = T' type Item=T; - // @has - '//*[@id="method.quux"]//h4[@class="code-header"]' 'fn quux(self)' + //@ has - '//*[@id="method.quux"]//h4[@class="code-header"]' 'fn quux(self)' fn quux(self) {} } impl<'a, T> Bar for &'a Foo { - // @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item = &'a T" + //@ has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item = &'a T" type Item=&'a T; - // @has - '//*[@id="method.quux-1"]//h4[@class="code-header"]' 'fn quux(self)' + //@ has - '//*[@id="method.quux-1"]//h4[@class="code-header"]' 'fn quux(self)' fn quux(self) {} } impl<'a, T> Bar for &'a mut Foo { - // @has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item = &'a mut T" + //@ has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item = &'a mut T" type Item=&'a mut T; - // @has - '//*[@id="method.quux-2"]//h4[@class="code-header"]' 'fn quux(self)' + //@ has - '//*[@id="method.quux-2"]//h4[@class="code-header"]' 'fn quux(self)' fn quux(self) {} } diff --git a/tests/rustdoc/anchor-id-trait-method-15169.rs b/tests/rustdoc/anchor-id-trait-method-15169.rs index 26bb59c1875..19eeeaee9d1 100644 --- a/tests/rustdoc/anchor-id-trait-method-15169.rs +++ b/tests/rustdoc/anchor-id-trait-method-15169.rs @@ -1,4 +1,4 @@ -// @has issue_15169/struct.Foo.html '//*[@id="method.eq"]' 'fn eq' +//@ has issue_15169/struct.Foo.html '//*[@id="method.eq"]' 'fn eq' // https://github.com/rust-lang/rust/issues/15169 #![crate_name="issue_15169"] diff --git a/tests/rustdoc/anchor-id-trait-tymethod-28478.rs b/tests/rustdoc/anchor-id-trait-tymethod-28478.rs index 5685040dc1e..e7adba7d06e 100644 --- a/tests/rustdoc/anchor-id-trait-tymethod-28478.rs +++ b/tests/rustdoc/anchor-id-trait-tymethod-28478.rs @@ -3,32 +3,32 @@ #![feature(associated_type_defaults)] -// @has issue_28478/trait.Bar.html +//@ has issue_28478/trait.Bar.html pub trait Bar { - // @has - '//*[@id="associatedtype.Bar"]' 'type Bar = ()' - // @has - '//*[@href="#associatedtype.Bar"]' 'Bar' + //@ has - '//*[@id="associatedtype.Bar"]' 'type Bar = ()' + //@ has - '//*[@href="#associatedtype.Bar"]' 'Bar' type Bar = (); - // @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize' - // @has - '//*[@href="#associatedconstant.Baz"]' 'Baz' + //@ has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize' + //@ has - '//*[@href="#associatedconstant.Baz"]' 'Baz' const Baz: usize = 7; - // @has - '//*[@id="tymethod.bar"]' 'fn bar' + //@ has - '//*[@id="tymethod.bar"]' 'fn bar' fn bar(); - // @has - '//*[@id="method.baz"]' 'fn baz' + //@ has - '//*[@id="method.baz"]' 'fn baz' fn baz() { } } -// @has issue_28478/struct.Foo.html +//@ has issue_28478/struct.Foo.html pub struct Foo; impl Foo { - // @has - '//*[@href="#method.foo"]' 'foo' + //@ has - '//*[@href="#method.foo"]' 'foo' pub fn foo() {} } impl Bar for Foo { - // @has - '//*[@href="trait.Bar.html#associatedtype.Bar"]' 'Bar' - // @has - '//*[@href="trait.Bar.html#associatedconstant.Baz"]' 'Baz' - // @has - '//*[@href="trait.Bar.html#tymethod.bar"]' 'bar' + //@ has - '//*[@href="trait.Bar.html#associatedtype.Bar"]' 'Bar' + //@ has - '//*[@href="trait.Bar.html#associatedconstant.Baz"]' 'Baz' + //@ has - '//*[@href="trait.Bar.html#tymethod.bar"]' 'bar' fn bar() {} - // @has - '//*[@href="trait.Bar.html#method.baz"]' 'baz' + //@ has - '//*[@href="trait.Bar.html#method.baz"]' 'baz' } diff --git a/tests/rustdoc/anchors.rs b/tests/rustdoc/anchors.rs index 034cf8eaf4f..255ef87351c 100644 --- a/tests/rustdoc/anchors.rs +++ b/tests/rustdoc/anchors.rs @@ -6,44 +6,44 @@ pub struct Foo; -// @has 'foo/trait.Bar.html' +//@ has 'foo/trait.Bar.html' pub trait Bar { // There should be no anchors here. - // @snapshot no_type_anchor - '//*[@id="associatedtype.T"]' + //@ snapshot no_type_anchor - '//*[@id="associatedtype.T"]' type T; // There should be no anchors here. - // @snapshot no_const_anchor - '//*[@id="associatedconstant.YOLO"]' + //@ snapshot no_const_anchor - '//*[@id="associatedconstant.YOLO"]' const YOLO: u32; // There should be no anchors here. - // @snapshot no_tymethod_anchor - '//*[@id="tymethod.foo"]' + //@ snapshot no_tymethod_anchor - '//*[@id="tymethod.foo"]' fn foo(); // There should be no anchors here. - // @snapshot no_trait_method_anchor - '//*[@id="method.bar"]' + //@ snapshot no_trait_method_anchor - '//*[@id="method.bar"]' fn bar() {} } -// @has 'foo/struct.Foo.html' +//@ has 'foo/struct.Foo.html' impl Bar for Foo { - // @has - '//*[@id="associatedtype.T"]/a[@class="anchor"]' '' + //@ has - '//*[@id="associatedtype.T"]/a[@class="anchor"]' '' type T = u32; - // @has - '//*[@id="associatedconstant.YOLO"]/a[@class="anchor"]' '' + //@ has - '//*[@id="associatedconstant.YOLO"]/a[@class="anchor"]' '' const YOLO: u32 = 0; - // @has - '//*[@id="method.foo"]/a[@class="anchor"]' '' + //@ has - '//*[@id="method.foo"]/a[@class="anchor"]' '' fn foo() {} // Same check for provided "bar" method. - // @has - '//*[@id="method.bar"]/a[@class="anchor"]' '' + //@ has - '//*[@id="method.bar"]/a[@class="anchor"]' '' } impl Foo { - // @snapshot no_const_anchor2 - '//*[@id="associatedconstant.X"]' + //@ snapshot no_const_anchor2 - '//*[@id="associatedconstant.X"]' // There should be no anchors here. pub const X: i32 = 0; - // @snapshot no_type_anchor2 - '//*[@id="associatedtype.Y"]' + //@ snapshot no_type_anchor2 - '//*[@id="associatedtype.Y"]' // There should be no anchors here. pub type Y = u32; - // @snapshot no_method_anchor - '//*[@id="method.new"]' + //@ snapshot no_method_anchor - '//*[@id="method.new"]' // There should be no anchors here. pub fn new() -> Self { Self } } diff --git a/tests/rustdoc/anonymous-lifetime.rs b/tests/rustdoc/anonymous-lifetime.rs index 390ed5a1f93..872f31a3602 100644 --- a/tests/rustdoc/anonymous-lifetime.rs +++ b/tests/rustdoc/anonymous-lifetime.rs @@ -11,8 +11,8 @@ pub trait Stream { fn size_hint(&self) -> (usize, Option); } -// @has 'foo/trait.Stream.html' -// @has - '//*[@class="code-header"]' 'impl Stream for &mut S' +//@ has 'foo/trait.Stream.html' +//@ has - '//*[@class="code-header"]' 'impl Stream for &mut S' impl Stream for &mut S { type Item = S::Item; diff --git a/tests/rustdoc/anonymous-reexport.rs b/tests/rustdoc/anonymous-reexport.rs index 839c1a30346..8021008dc66 100644 --- a/tests/rustdoc/anonymous-reexport.rs +++ b/tests/rustdoc/anonymous-reexport.rs @@ -2,16 +2,16 @@ // This test ensures we don't display anonymous (non-inline) re-exports of public items. -// @has 'foo/index.html' -// @has - '//*[@id="main-content"]' '' +//@ has 'foo/index.html' +//@ has - '//*[@id="main-content"]' '' // We check that the only "h2" present are "Structs" (for "Bla") and "Re-exports". -// @count - '//*[@id="main-content"]/h2' 2 -// @has - '//*[@id="main-content"]/h2' 'Structs' -// @has - '//*[@id="main-content"]/h2' 'Re-exports' +//@ count - '//*[@id="main-content"]/h2' 2 +//@ has - '//*[@id="main-content"]/h2' 'Structs' +//@ has - '//*[@id="main-content"]/h2' 'Re-exports' // The 3 re-exports. -// @count - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 3 +//@ count - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 3 // The public struct. -// @count - '//*[@id="main-content"]//a[@class="struct"]' 1 +//@ count - '//*[@id="main-content"]//a[@class="struct"]' 1 mod ext { pub trait Foo {} diff --git a/tests/rustdoc/array-links.rs b/tests/rustdoc/array-links.rs index 8ee294daa96..d185233c728 100644 --- a/tests/rustdoc/array-links.rs +++ b/tests/rustdoc/array-links.rs @@ -3,26 +3,26 @@ pub struct MyBox(*const T); -// @has 'foo/fn.alpha.html' -// @snapshot link_slice_u32 - '//pre[@class="rust item-decl"]/code' +//@ has 'foo/fn.alpha.html' +//@ snapshot link_slice_u32 - '//pre[@class="rust item-decl"]/code' pub fn alpha() -> &'static [u32; 1] { loop {} } -// @has 'foo/fn.beta.html' -// @snapshot link_slice_generic - '//pre[@class="rust item-decl"]/code' +//@ has 'foo/fn.beta.html' +//@ snapshot link_slice_generic - '//pre[@class="rust item-decl"]/code' pub fn beta() -> &'static [T; 1] { loop {} } -// @has 'foo/fn.gamma.html' -// @snapshot link_box_u32 - '//pre[@class="rust item-decl"]/code' +//@ has 'foo/fn.gamma.html' +//@ snapshot link_box_u32 - '//pre[@class="rust item-decl"]/code' pub fn gamma() -> MyBox<[u32; 1]> { loop {} } -// @has 'foo/fn.delta.html' -// @snapshot link_box_generic - '//pre[@class="rust item-decl"]/code' +//@ has 'foo/fn.delta.html' +//@ snapshot link_box_generic - '//pre[@class="rust item-decl"]/code' pub fn delta() -> MyBox<[T; 1]> { loop {} } diff --git a/tests/rustdoc/asm-foreign.rs b/tests/rustdoc/asm-foreign.rs index d7550ca5aca..ebae53ea19c 100644 --- a/tests/rustdoc/asm-foreign.rs +++ b/tests/rustdoc/asm-foreign.rs @@ -2,7 +2,7 @@ use std::arch::asm; -// @has asm_foreign/fn.aarch64.html +//@ has asm_foreign/fn.aarch64.html pub unsafe fn aarch64(a: f64, b: f64) -> f64 { let c; asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") { @@ -12,7 +12,7 @@ pub unsafe fn aarch64(a: f64, b: f64) -> f64 { c } -// @has asm_foreign/fn.x86.html +//@ has asm_foreign/fn.x86.html pub unsafe fn x86(a: f64, b: f64) -> f64 { let c; asm!("addsd {}, {}, xmm0", out(xmm_reg) c, in(xmm_reg) a, in("xmm0") b); diff --git a/tests/rustdoc/asm-foreign2.rs b/tests/rustdoc/asm-foreign2.rs index c3b194b1660..c0f3224a90f 100644 --- a/tests/rustdoc/asm-foreign2.rs +++ b/tests/rustdoc/asm-foreign2.rs @@ -3,7 +3,7 @@ use std::arch::asm; -// @has asm_foreign2/fn.x86.html +//@ has asm_foreign2/fn.x86.html pub unsafe fn x86(x: i64) -> i64 { let y; asm!("movq {}, {}", in(reg) x, out(reg) y, options(att_syntax)); diff --git a/tests/rustdoc/asref-for-and-of-local-82465.rs b/tests/rustdoc/asref-for-and-of-local-82465.rs index e6204688904..9c96b72ee27 100644 --- a/tests/rustdoc/asref-for-and-of-local-82465.rs +++ b/tests/rustdoc/asref-for-and-of-local-82465.rs @@ -4,14 +4,14 @@ use std::convert::AsRef; pub struct Local; -// @has foo/struct.Local.html '//h3[@class="code-header"]' 'impl AsRef for Local' +//@ has foo/struct.Local.html '//h3[@class="code-header"]' 'impl AsRef for Local' impl AsRef for Local { fn as_ref(&self) -> &str { todo!() } } -// @has - '//h3[@class="code-header"]' 'impl AsRef for str' +//@ has - '//h3[@class="code-header"]' 'impl AsRef for str' impl AsRef for str { fn as_ref(&self) -> &Local { todo!() diff --git a/tests/rustdoc/assoc-consts-version.rs b/tests/rustdoc/assoc-consts-version.rs index 6060bc0a6fd..db4d759acab 100644 --- a/tests/rustdoc/assoc-consts-version.rs +++ b/tests/rustdoc/assoc-consts-version.rs @@ -8,7 +8,7 @@ pub struct SomeStruct; impl SomeStruct { - // @has 'foo/struct.SomeStruct.html' \ + //@ has 'foo/struct.SomeStruct.html' \ // '//*[@id="associatedconstant.SOME_CONST"]//span[@class="since"]' '1.1.2' #[stable(since="1.1.2", feature="rust2")] pub const SOME_CONST: usize = 0; diff --git a/tests/rustdoc/assoc-consts.rs b/tests/rustdoc/assoc-consts.rs index 08dfa879d43..cb8e839541c 100644 --- a/tests/rustdoc/assoc-consts.rs +++ b/tests/rustdoc/assoc-consts.rs @@ -1,11 +1,11 @@ pub trait Foo { - // @has assoc_consts/trait.Foo.html '//pre[@class="rust item-decl"]' \ + //@ has assoc_consts/trait.Foo.html '//pre[@class="rust item-decl"]' \ // 'const FOO: usize = 13usize;' - // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize' + //@ has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize' const FOO: usize = 12 + 1; - // @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool' + //@ has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool' const FOO_NO_DEFAULT: bool; - // @!hasraw - FOO_HIDDEN + //@ !hasraw - FOO_HIDDEN #[doc(hidden)] const FOO_HIDDEN: u8 = 0; } @@ -13,22 +13,22 @@ pub trait Foo { pub struct Bar; impl Foo for Bar { - // @has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Foo for Bar' - // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize' + //@ has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Foo for Bar' + //@ has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize' const FOO: usize = 12; - // @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool' + //@ has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool' const FOO_NO_DEFAULT: bool = false; - // @!hasraw - FOO_HIDDEN + //@ !hasraw - FOO_HIDDEN #[doc(hidden)] const FOO_HIDDEN: u8 = 0; } impl Bar { - // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \ + //@ has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \ // 'const BAR: usize' pub const BAR: usize = 3; - // @has - '//*[@id="associatedconstant.BAR_ESCAPED"]' \ + //@ has - '//*[@id="associatedconstant.BAR_ESCAPED"]' \ // "const BAR_ESCAPED: &'static str = \"markup\"" pub const BAR_ESCAPED: &'static str = "markup"; } @@ -36,7 +36,7 @@ impl Bar { pub struct Baz<'a, U: 'a, T>(T, &'a [U]); impl Bar { - // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAZ"]' \ + //@ has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAZ"]' \ // "const BAZ: Baz<'static, u8, u32>" pub const BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3]); } @@ -44,60 +44,60 @@ impl Bar { pub fn f(_: &(ToString + 'static)) {} impl Bar { - // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \ + //@ has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \ // "const F: fn(_: &(dyn ToString + 'static))" pub const F: fn(_: &(ToString + 'static)) = f; } impl Bar { - // @!hasraw assoc_consts/struct.Bar.html 'BAR_PRIVATE' + //@ !hasraw assoc_consts/struct.Bar.html 'BAR_PRIVATE' const BAR_PRIVATE: char = 'a'; - // @!hasraw assoc_consts/struct.Bar.html 'BAR_HIDDEN' + //@ !hasraw assoc_consts/struct.Bar.html 'BAR_HIDDEN' #[doc(hidden)] pub const BAR_HIDDEN: &'static str = "a"; } -// @has assoc_consts/trait.Qux.html +//@ has assoc_consts/trait.Qux.html pub trait Qux { - // @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8' - // @has - '//*[@class="docblock"]' "Docs for QUX0 in trait." + //@ has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8' + //@ has - '//*[@class="docblock"]' "Docs for QUX0 in trait." /// Docs for QUX0 in trait. const QUX0: u8; - // @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8' - // @has - '//*[@class="docblock"]' "Docs for QUX1 in trait." + //@ has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8' + //@ has - '//*[@class="docblock"]' "Docs for QUX1 in trait." /// Docs for QUX1 in trait. const QUX1: i8; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16' - // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait." + //@ has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16' + //@ has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait." /// Docs for QUX_DEFAULT12 in trait. const QUX_DEFAULT0: u16 = 1; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16' - // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in trait." + //@ has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16' + //@ has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in trait." /// Docs for QUX_DEFAULT1 in trait. const QUX_DEFAULT1: i16 = 2; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32' - // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait." + //@ has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32' + //@ has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait." /// Docs for QUX_DEFAULT2 in trait. const QUX_DEFAULT2: u32 = 3; } -// @has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Qux for Bar' +//@ has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Qux for Bar' impl Qux for Bar { - // @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8' - // @has - '//*[@class="docblock"]' "Docs for QUX0 in trait." + //@ has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8' + //@ has - '//*[@class="docblock"]' "Docs for QUX0 in trait." /// Docs for QUX0 in trait. const QUX0: u8 = 4; - // @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8' - // @has - '//*[@class="docblock"]' "Docs for QUX1 in impl." + //@ has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8' + //@ has - '//*[@class="docblock"]' "Docs for QUX1 in impl." /// Docs for QUX1 in impl. const QUX1: i8 = 5; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16' - // @has - '//div[@class="impl-items"]//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait." + //@ has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16' + //@ has - '//div[@class="impl-items"]//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait." const QUX_DEFAULT0: u16 = 6; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16' - // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in impl." + //@ has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16' + //@ has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in impl." /// Docs for QUX_DEFAULT1 in impl. const QUX_DEFAULT1: i16 = 7; - // @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32' - // @has - '//div[@class="impl-items"]//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait." + //@ has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32' + //@ has - '//div[@class="impl-items"]//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait." } diff --git a/tests/rustdoc/assoc-item-cast.rs b/tests/rustdoc/assoc-item-cast.rs index ad8235985bc..17b7cf6f0da 100644 --- a/tests/rustdoc/assoc-item-cast.rs +++ b/tests/rustdoc/assoc-item-cast.rs @@ -9,6 +9,6 @@ pub trait AsExpression { fn as_expression(self) -> Self::Expression; } -// @has foo/type.AsExprOf.html -// @has - '//pre[@class="rust item-decl"]' 'type AsExprOf = >::Expression;' +//@ has foo/type.AsExprOf.html +//@ has - '//pre[@class="rust item-decl"]' 'type AsExprOf = >::Expression;' pub type AsExprOf = >::Expression; diff --git a/tests/rustdoc/assoc-type-bindings-20646.rs b/tests/rustdoc/assoc-type-bindings-20646.rs index 3d752551d1b..c79d07ff5bd 100644 --- a/tests/rustdoc/assoc-type-bindings-20646.rs +++ b/tests/rustdoc/assoc-type-bindings-20646.rs @@ -7,22 +7,22 @@ extern crate issue_20646; -// @has issue_20646/trait.Trait.html \ +//@ has issue_20646/trait.Trait.html \ // '//*[@id="associatedtype.Output"]' \ // 'type Output' pub trait Trait { type Output; } -// @has issue_20646/fn.fun.html \ +//@ has issue_20646/fn.fun.html \ // '//pre[@class="rust item-decl"]' 'where T: Trait' pub fn fun(_: T) where T: Trait {} pub mod reexport { - // @has issue_20646/reexport/trait.Trait.html \ + //@ has issue_20646/reexport/trait.Trait.html \ // '//*[@id="associatedtype.Output"]' \ // 'type Output' - // @has issue_20646/reexport/fn.fun.html \ + //@ has issue_20646/reexport/fn.fun.html \ // '//pre[@class="rust item-decl"]' 'where T: Trait' pub use issue_20646::{Trait, fun}; } diff --git a/tests/rustdoc/assoc-types.rs b/tests/rustdoc/assoc-types.rs index e74db7578d1..8247d8b91e8 100644 --- a/tests/rustdoc/assoc-types.rs +++ b/tests/rustdoc/assoc-types.rs @@ -1,19 +1,19 @@ #![crate_type="lib"] -// @has assoc_types/trait.Index.html +//@ has assoc_types/trait.Index.html pub trait Index { - // @has - '//*[@id="associatedtype.Output"]//h4[@class="code-header"]' 'type Output: ?Sized' + //@ has - '//*[@id="associatedtype.Output"]//h4[@class="code-header"]' 'type Output: ?Sized' type Output: ?Sized; - // @has - '//*[@id="tymethod.index"]//h4[@class="code-header"]' \ + //@ has - '//*[@id="tymethod.index"]//h4[@class="code-header"]' \ // "fn index<'a>(&'a self, index: I) -> &'a Self::Output" - // @has - '//*[@id="tymethod.index"]//h4[@class="code-header"]//a[@href="trait.Index.html#associatedtype.Output"]' \ + //@ has - '//*[@id="tymethod.index"]//h4[@class="code-header"]//a[@href="trait.Index.html#associatedtype.Output"]' \ // "Output" fn index<'a>(&'a self, index: I) -> &'a Self::Output; } -// @has assoc_types/fn.use_output.html -// @has - '//pre[@class="rust item-decl"]' '-> &T::Output' -// @has - '//pre[@class="rust item-decl"]//a[@href="trait.Index.html#associatedtype.Output"]' 'Output' +//@ has assoc_types/fn.use_output.html +//@ has - '//pre[@class="rust item-decl"]' '-> &T::Output' +//@ has - '//pre[@class="rust item-decl"]//a[@href="trait.Index.html#associatedtype.Output"]' 'Output' pub fn use_output>(obj: &T, index: usize) -> &T::Output { obj.index(index) } @@ -22,14 +22,14 @@ pub trait Feed { type Input; } -// @has assoc_types/fn.use_input.html -// @has - '//pre[@class="rust item-decl"]' 'T::Input' -// @has - '//pre[@class="rust item-decl"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input' +//@ has assoc_types/fn.use_input.html +//@ has - '//pre[@class="rust item-decl"]' 'T::Input' +//@ has - '//pre[@class="rust item-decl"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input' pub fn use_input(_feed: &T, _element: T::Input) { } -// @has assoc_types/fn.cmp_input.html -// @has - '//pre[@class="rust item-decl"]' 'where T::Input: PartialEq' -// @has - '//pre[@class="rust item-decl"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input' +//@ has assoc_types/fn.cmp_input.html +//@ has - '//pre[@class="rust item-decl"]' 'where T::Input: PartialEq' +//@ has - '//pre[@class="rust item-decl"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input' pub fn cmp_input(a: &T::Input, b: &U::Input) -> bool where T::Input: PartialEq { diff --git a/tests/rustdoc/associated-consts.rs b/tests/rustdoc/associated-consts.rs index adb155bb525..2a7269a89be 100644 --- a/tests/rustdoc/associated-consts.rs +++ b/tests/rustdoc/associated-consts.rs @@ -8,9 +8,9 @@ pub trait Trait { pub struct Bar; -// @has 'foo/struct.Bar.html' -// @!has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants' -// @!has - '//div[@class="sidebar-elems"]//a' 'FOO' +//@ has 'foo/struct.Bar.html' +//@ !has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants' +//@ !has - '//div[@class="sidebar-elems"]//a' 'FOO' impl Trait for Bar { const FOO: u32 = 1; @@ -21,9 +21,9 @@ pub enum Foo { A, } -// @has 'foo/enum.Foo.html' -// @!has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants' -// @!has - '//div[@class="sidebar-elems"]//a' 'FOO' +//@ has 'foo/enum.Foo.html' +//@ !has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants' +//@ !has - '//div[@class="sidebar-elems"]//a' 'FOO' impl Trait for Foo { const FOO: u32 = 1; @@ -32,9 +32,9 @@ impl Trait for Foo { pub struct Baz; -// @has 'foo/struct.Baz.html' -// @has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants' -// @has - '//div[@class="sidebar-elems"]//a' 'FOO' +//@ has 'foo/struct.Baz.html' +//@ has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants' +//@ has - '//div[@class="sidebar-elems"]//a' 'FOO' impl Baz { pub const FOO: u32 = 42; } @@ -43,9 +43,9 @@ pub enum Quux { B, } -// @has 'foo/enum.Quux.html' -// @has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants' -// @has - '//div[@class="sidebar-elems"]//a' 'FOO' +//@ has 'foo/enum.Quux.html' +//@ has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants' +//@ has - '//div[@class="sidebar-elems"]//a' 'FOO' impl Quux { pub const FOO: u32 = 42; } diff --git a/tests/rustdoc/async-fn-opaque-item.rs b/tests/rustdoc/async-fn-opaque-item.rs index 566c1c233ce..d45183f96dd 100644 --- a/tests/rustdoc/async-fn-opaque-item.rs +++ b/tests/rustdoc/async-fn-opaque-item.rs @@ -5,11 +5,11 @@ // that comes from an async fn desugaring. // Check that we don't document an unnamed opaque type -// @!has async_fn_opaque_item/opaque..html +//@ !has async_fn_opaque_item/opaque..html // Checking there is only a "Functions" header and no "Opaque types". -// @has async_fn_opaque_item/index.html -// @count - '//*[@class="section-header"]' 1 -// @has - '//*[@class="section-header"]' 'Functions' +//@ has async_fn_opaque_item/index.html +//@ count - '//*[@class="section-header"]' 1 +//@ has - '//*[@class="section-header"]' 'Functions' pub async fn test() {} diff --git a/tests/rustdoc/async-fn.rs b/tests/rustdoc/async-fn.rs index 4de5d8575b0..3d49766c55e 100644 --- a/tests/rustdoc/async-fn.rs +++ b/tests/rustdoc/async-fn.rs @@ -1,43 +1,43 @@ //@ edition:2018 -// @has async_fn/fn.foo.html '//pre[@class="rust item-decl"]' 'pub async fn foo() -> Option' +//@ has async_fn/fn.foo.html '//pre[@class="rust item-decl"]' 'pub async fn foo() -> Option' pub async fn foo() -> Option { None } -// @has async_fn/fn.bar.html '//pre[@class="rust item-decl"]' 'pub async fn bar(a: i32, b: i32) -> i32' +//@ has async_fn/fn.bar.html '//pre[@class="rust item-decl"]' 'pub async fn bar(a: i32, b: i32) -> i32' pub async fn bar(a: i32, b: i32) -> i32 { 0 } -// @has async_fn/fn.baz.html '//pre[@class="rust item-decl"]' 'pub async fn baz(a: T) -> T' +//@ has async_fn/fn.baz.html '//pre[@class="rust item-decl"]' 'pub async fn baz(a: T) -> T' pub async fn baz(a: T) -> T { a } -// @has async_fn/fn.qux.html '//pre[@class="rust item-decl"]' 'pub async unsafe fn qux() -> char' +//@ has async_fn/fn.qux.html '//pre[@class="rust item-decl"]' 'pub async unsafe fn qux() -> char' pub async unsafe fn qux() -> char { '⚠' } -// @has async_fn/fn.mut_args.html '//pre[@class="rust item-decl"]' 'pub async fn mut_args(a: usize)' +//@ has async_fn/fn.mut_args.html '//pre[@class="rust item-decl"]' 'pub async fn mut_args(a: usize)' pub async fn mut_args(mut a: usize) {} -// @has async_fn/fn.mut_ref.html '//pre[@class="rust item-decl"]' 'pub async fn mut_ref(x: i32)' +//@ has async_fn/fn.mut_ref.html '//pre[@class="rust item-decl"]' 'pub async fn mut_ref(x: i32)' pub async fn mut_ref(ref mut x: i32) {} trait Bar {} impl Bar for () {} -// @has async_fn/fn.quux.html '//pre[@class="rust item-decl"]' 'pub async fn quux() -> impl Bar' +//@ has async_fn/fn.quux.html '//pre[@class="rust item-decl"]' 'pub async fn quux() -> impl Bar' pub async fn quux() -> impl Bar { () } -// @has async_fn/struct.Foo.html -// @matches - '//h4[@class="code-header"]' 'pub async fn f\(\)$' -// @matches - '//h4[@class="code-header"]' 'pub async unsafe fn g\(\)$' -// @matches - '//h4[@class="code-header"]' 'pub async fn mut_self\(self, first: usize\)$' +//@ has async_fn/struct.Foo.html +//@ matches - '//h4[@class="code-header"]' 'pub async fn f\(\)$' +//@ matches - '//h4[@class="code-header"]' 'pub async unsafe fn g\(\)$' +//@ matches - '//h4[@class="code-header"]' 'pub async fn mut_self\(self, first: usize\)$' pub struct Foo; impl Foo { @@ -51,49 +51,49 @@ pub trait Pattern<'a> {} impl Pattern<'_> for () {} pub trait Trait {} -// @has async_fn/fn.const_generics.html -// @has - '//pre[@class="rust item-decl"]' 'pub async fn const_generics(_: impl Trait)' +//@ has async_fn/fn.const_generics.html +//@ has - '//pre[@class="rust item-decl"]' 'pub async fn const_generics(_: impl Trait)' pub async fn const_generics(_: impl Trait) {} // test that elided lifetimes are properly elided and not displayed as `'_` // regression test for #63037 -// @has async_fn/fn.elided.html -// @has - '//pre[@class="rust item-decl"]' 'pub async fn elided(foo: &str) -> &str' +//@ has async_fn/fn.elided.html +//@ has - '//pre[@class="rust item-decl"]' 'pub async fn elided(foo: &str) -> &str' pub async fn elided(foo: &str) -> &str { "" } // This should really be shown as written, but for implementation reasons it's difficult. // See `impl Clean for TyKind::Ref`. -// @has async_fn/fn.user_elided.html -// @has - '//pre[@class="rust item-decl"]' 'pub async fn user_elided(foo: &str) -> &str' +//@ has async_fn/fn.user_elided.html +//@ has - '//pre[@class="rust item-decl"]' 'pub async fn user_elided(foo: &str) -> &str' pub async fn user_elided(foo: &'_ str) -> &str { "" } -// @has async_fn/fn.static_trait.html -// @has - '//pre[@class="rust item-decl"]' 'pub async fn static_trait(foo: &str) -> Box' +//@ has async_fn/fn.static_trait.html +//@ has - '//pre[@class="rust item-decl"]' 'pub async fn static_trait(foo: &str) -> Box' pub async fn static_trait(foo: &str) -> Box { Box::new(()) } -// @has async_fn/fn.lifetime_for_trait.html -// @has - '//pre[@class="rust item-decl"]' "pub async fn lifetime_for_trait(foo: &str) -> Box" +//@ has async_fn/fn.lifetime_for_trait.html +//@ has - '//pre[@class="rust item-decl"]' "pub async fn lifetime_for_trait(foo: &str) -> Box" pub async fn lifetime_for_trait(foo: &str) -> Box { Box::new(()) } -// @has async_fn/fn.elided_in_input_trait.html -// @has - '//pre[@class="rust item-decl"]' "pub async fn elided_in_input_trait(t: impl Pattern<'_>)" +//@ has async_fn/fn.elided_in_input_trait.html +//@ has - '//pre[@class="rust item-decl"]' "pub async fn elided_in_input_trait(t: impl Pattern<'_>)" pub async fn elided_in_input_trait(t: impl Pattern<'_>) {} struct AsyncFdReadyGuard<'a, T> { x: &'a T } impl Foo { - // @has async_fn/struct.Foo.html - // @has - '//*[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar, ) -> impl Iterator' + //@ has async_fn/struct.Foo.html + //@ has - '//*[@class="method"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar, ) -> impl Iterator' pub async fn complicated_lifetimes(&self, context: &impl Bar) -> impl Iterator { [0].iter() } // taken from `tokio` as an example of a method that was particularly bad before - // @has - '//*[@class="method"]' "pub async fn readable(&self) -> Result, ()>" + //@ has - '//*[@class="method"]' "pub async fn readable(&self) -> Result, ()>" pub async fn readable(&self) -> Result, ()> { Err(()) } - // @has - '//*[@class="method"]' "pub async fn mut_self(&mut self)" + //@ has - '//*[@class="method"]' "pub async fn mut_self(&mut self)" pub async fn mut_self(&mut self) {} } // test named lifetimes, just in case -// @has async_fn/fn.named.html -// @has - '//pre[@class="rust item-decl"]' "pub async fn named<'a, 'b>(foo: &'a str) -> &'b str" +//@ has async_fn/fn.named.html +//@ has - '//pre[@class="rust item-decl"]' "pub async fn named<'a, 'b>(foo: &'a str) -> &'b str" pub async fn named<'a, 'b>(foo: &'a str) -> &'b str { "" } -// @has async_fn/fn.named_trait.html -// @has - '//pre[@class="rust item-decl"]' "pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b>" +//@ has async_fn/fn.named_trait.html +//@ has - '//pre[@class="rust item-decl"]' "pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b>" pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b> {} diff --git a/tests/rustdoc/async-trait-sig.rs b/tests/rustdoc/async-trait-sig.rs index 40e68ce9b3c..be790f6ed7f 100644 --- a/tests/rustdoc/async-trait-sig.rs +++ b/tests/rustdoc/async-trait-sig.rs @@ -3,10 +3,10 @@ #![allow(incomplete_features)] pub trait Foo { - // @has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn bar() -> i32" + //@ has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn bar() -> i32" async fn bar() -> i32; - // @has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn baz() -> i32" + //@ has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn baz() -> i32" async fn baz() -> i32 { 1 } diff --git a/tests/rustdoc/async-trait.rs b/tests/rustdoc/async-trait.rs index 980a812815b..a6ee340e2dd 100644 --- a/tests/rustdoc/async-trait.rs +++ b/tests/rustdoc/async-trait.rs @@ -7,7 +7,7 @@ extern crate async_trait_dep; pub struct Oink {} -// @has 'async_trait/struct.Oink.html' '//h4[@class="code-header"]' "async fn woof()" +//@ has 'async_trait/struct.Oink.html' '//h4[@class="code-header"]' "async fn woof()" impl async_trait_dep::Meow for Oink { async fn woof() { todo!() diff --git a/tests/rustdoc/attribute-rendering.rs b/tests/rustdoc/attribute-rendering.rs index a652fda1604..841533814c3 100644 --- a/tests/rustdoc/attribute-rendering.rs +++ b/tests/rustdoc/attribute-rendering.rs @@ -1,7 +1,7 @@ #![crate_name = "foo"] -// @has 'foo/fn.f.html' -// @has - //*[@'class="rust item-decl"]' '#[export_name = "f"] pub fn f()' +//@ has 'foo/fn.f.html' +//@ has - //*[@'class="rust item-decl"]' '#[export_name = "f"] pub fn f()' #[export_name = "\ f"] pub fn f() {} diff --git a/tests/rustdoc/attributes.rs b/tests/rustdoc/attributes.rs index 86333c7534a..e34468a88b1 100644 --- a/tests/rustdoc/attributes.rs +++ b/tests/rustdoc/attributes.rs @@ -1,13 +1,13 @@ #![crate_name = "foo"] -// @has foo/fn.f.html '//pre[@class="rust item-decl"]' '#[no_mangle]' +//@ has foo/fn.f.html '//pre[@class="rust item-decl"]' '#[no_mangle]' #[no_mangle] pub extern "C" fn f() {} -// @has foo/fn.g.html '//pre[@class="rust item-decl"]' '#[export_name = "bar"]' +//@ has foo/fn.g.html '//pre[@class="rust item-decl"]' '#[export_name = "bar"]' #[export_name = "bar"] pub extern "C" fn g() {} -// @has foo/struct.Repr.html '//pre[@class="rust item-decl"]' '#[repr(C, align(8))]' +//@ has foo/struct.Repr.html '//pre[@class="rust item-decl"]' '#[repr(C, align(8))]' #[repr(C, align(8))] pub struct Repr; diff --git a/tests/rustdoc/auto-impl-primitive.rs b/tests/rustdoc/auto-impl-primitive.rs index a6db93dbc33..3dab02506ca 100644 --- a/tests/rustdoc/auto-impl-primitive.rs +++ b/tests/rustdoc/auto-impl-primitive.rs @@ -4,7 +4,7 @@ pub use std::fs::File; -// @has 'foo/primitive.i16.html' '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementation' +//@ has 'foo/primitive.i16.html' '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementation' #[rustc_doc_primitive = "i16"] /// I love poneys! mod prim {} diff --git a/tests/rustdoc/auto-trait-bounds-by-associated-type-50159.rs b/tests/rustdoc/auto-trait-bounds-by-associated-type-50159.rs index 7d9133b85a6..2803c4da437 100644 --- a/tests/rustdoc/auto-trait-bounds-by-associated-type-50159.rs +++ b/tests/rustdoc/auto-trait-bounds-by-associated-type-50159.rs @@ -16,11 +16,11 @@ where type Item2 = C; } -// @has foo/struct.Switch.html -// @has - '//h3[@class="code-header"]' 'impl Send for Switchwhere ::Item: Send' -// @has - '//h3[@class="code-header"]' 'impl Sync for Switchwhere ::Item: Sync' -// @count - '//*[@id="implementations-list"]//*[@class="impl"]' 0 -// @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]' 6 +//@ has foo/struct.Switch.html +//@ has - '//h3[@class="code-header"]' 'impl Send for Switchwhere ::Item: Send' +//@ has - '//h3[@class="code-header"]' 'impl Sync for Switchwhere ::Item: Sync' +//@ count - '//*[@id="implementations-list"]//*[@class="impl"]' 0 +//@ count - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]' 6 pub struct Switch { pub inner: ::Item2, } diff --git a/tests/rustdoc/auto-trait-bounds-inference-variables-54705.rs b/tests/rustdoc/auto-trait-bounds-inference-variables-54705.rs index 00be0042fb0..ef159fca872 100644 --- a/tests/rustdoc/auto-trait-bounds-inference-variables-54705.rs +++ b/tests/rustdoc/auto-trait-bounds-inference-variables-54705.rs @@ -3,11 +3,11 @@ pub trait ScopeHandle<'scope> {} -// @has foo/struct.ScopeFutureContents.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has foo/struct.ScopeFutureContents.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<'scope, S> Send for ScopeFutureContents<'scope, S>where S: Sync" // -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<'scope, S> Sync for ScopeFutureContents<'scope, S>where S: Sync" pub struct ScopeFutureContents<'scope, S> where S: ScopeHandle<'scope>, diff --git a/tests/rustdoc/auto-trait-bounds-where-51236.rs b/tests/rustdoc/auto-trait-bounds-where-51236.rs index 30c81e79601..c892b6d0abf 100644 --- a/tests/rustdoc/auto-trait-bounds-where-51236.rs +++ b/tests/rustdoc/auto-trait-bounds-where-51236.rs @@ -9,8 +9,8 @@ pub mod traits { } } -// @has foo/struct.Owned.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has foo/struct.Owned.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Send for Ownedwhere >::Reader: Send" pub struct Owned where T: for<'a> ::traits::Owned<'a> { marker: PhantomData<>::Reader>, diff --git a/tests/rustdoc/auto-trait-negative-impl-55321.rs b/tests/rustdoc/auto-trait-negative-impl-55321.rs index e9be1ff854e..147f44da117 100644 --- a/tests/rustdoc/auto-trait-negative-impl-55321.rs +++ b/tests/rustdoc/auto-trait-negative-impl-55321.rs @@ -3,19 +3,19 @@ #![feature(negative_impls)] -// @has foo/struct.A.html -// @has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has foo/struct.A.html +//@ has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl !Send for A" -// @has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl !Sync for A" pub struct A(); impl !Send for A {} impl !Sync for A {} -// @has foo/struct.B.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has foo/struct.B.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl !Send for B" -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl !Sync for B" pub struct B(A, Box); diff --git a/tests/rustdoc/auto-trait-not-send.rs b/tests/rustdoc/auto-trait-not-send.rs index 661d905ab63..0a31952f5e1 100644 --- a/tests/rustdoc/auto-trait-not-send.rs +++ b/tests/rustdoc/auto-trait-not-send.rs @@ -1,8 +1,8 @@ #![crate_name = "foo"] -// @has 'foo/struct.Foo.html' -// @has - '//*[@id="impl-Send-for-Foo"]' 'impl !Send for Foo' -// @has - '//*[@id="impl-Sync-for-Foo"]' 'impl !Sync for Foo' +//@ has 'foo/struct.Foo.html' +//@ has - '//*[@id="impl-Send-for-Foo"]' 'impl !Send for Foo' +//@ has - '//*[@id="impl-Sync-for-Foo"]' 'impl !Sync for Foo' pub struct Foo(*const i8); pub trait Whatever: Send {} impl Whatever for T {} diff --git a/tests/rustdoc/auto-traits.rs b/tests/rustdoc/auto-traits.rs index 01439c8601b..dce406ed3e3 100644 --- a/tests/rustdoc/auto-traits.rs +++ b/tests/rustdoc/auto-traits.rs @@ -6,8 +6,8 @@ extern crate auto_traits; -// @has 'foo/trait.Foo.html' '//pre' 'pub unsafe auto trait Foo' +//@ has 'foo/trait.Foo.html' '//pre' 'pub unsafe auto trait Foo' pub unsafe auto trait Foo {} -// @has 'foo/trait.Bar.html' '//pre' 'pub unsafe auto trait Bar' +//@ has 'foo/trait.Bar.html' '//pre' 'pub unsafe auto trait Bar' pub use auto_traits::Bar; diff --git a/tests/rustdoc/auto_aliases.rs b/tests/rustdoc/auto_aliases.rs index a047c76b637..920aba805cd 100644 --- a/tests/rustdoc/auto_aliases.rs +++ b/tests/rustdoc/auto_aliases.rs @@ -1,6 +1,6 @@ #![feature(auto_traits)] -// @has auto_aliases/trait.Bar.html '//*[@data-aliases="auto_aliases::Foo"]' 'impl Bar for Foo' +//@ has auto_aliases/trait.Bar.html '//*[@data-aliases="auto_aliases::Foo"]' 'impl Bar for Foo' pub struct Foo; pub auto trait Bar {} diff --git a/tests/rustdoc/auxiliary/alias-reexport2.rs b/tests/rustdoc/auxiliary/alias-reexport2.rs index 9f6910572ad..ee1f242c1d4 100644 --- a/tests/rustdoc/auxiliary/alias-reexport2.rs +++ b/tests/rustdoc/auxiliary/alias-reexport2.rs @@ -4,9 +4,9 @@ extern crate alias_reexport; pub use alias_reexport::Reexported; -// @has 'foo/fn.foo.html' -// @has - '//*[@class="docblock item-decl"]' 'pub fn foo() -> 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' +//@ has 'foo/fn.foo2.html' +//@ has - '//*[@class="docblock item-decl"]' 'pub fn foo2() -> Result' pub fn foo2() -> Result { Ok(0) } diff --git a/tests/rustdoc/auxiliary/rustdoc-ffi.rs b/tests/rustdoc/auxiliary/rustdoc-ffi.rs index b74d190b526..98e2b55699a 100644 --- a/tests/rustdoc/auxiliary/rustdoc-ffi.rs +++ b/tests/rustdoc/auxiliary/rustdoc-ffi.rs @@ -1,6 +1,6 @@ #![crate_type="lib"] extern "C" { - // @has lib/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)' + //@ has lib/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)' pub fn foreigner(cold_as_ice: u32); } diff --git a/tests/rustdoc/bad-codeblock-syntax.rs b/tests/rustdoc/bad-codeblock-syntax.rs index 9ec089fd7ad..b14aca20679 100644 --- a/tests/rustdoc/bad-codeblock-syntax.rs +++ b/tests/rustdoc/bad-codeblock-syntax.rs @@ -1,43 +1,43 @@ #![allow(rustdoc::invalid_rust_codeblocks)] -// @has bad_codeblock_syntax/fn.foo.html -// @has - '//*[@class="docblock"]' '\_' +//@ has bad_codeblock_syntax/fn.foo.html +//@ has - '//*[@class="docblock"]' '\_' /// ``` /// \_ /// ``` pub fn foo() {} -// @has bad_codeblock_syntax/fn.bar.html -// @has - '//*[@class="docblock"]' '`baz::foobar`' +//@ has bad_codeblock_syntax/fn.bar.html +//@ has - '//*[@class="docblock"]' '`baz::foobar`' /// ``` /// `baz::foobar` /// ``` pub fn bar() {} -// @has bad_codeblock_syntax/fn.quux.html -// @has - '//*[@class="docblock"]' '\_' +//@ has bad_codeblock_syntax/fn.quux.html +//@ has - '//*[@class="docblock"]' '\_' /// ```rust /// \_ /// ``` pub fn quux() {} -// @has bad_codeblock_syntax/fn.ok.html -// @has - '//*[@class="docblock"]' '\_' +//@ has bad_codeblock_syntax/fn.ok.html +//@ has - '//*[@class="docblock"]' '\_' /// ```text /// \_ /// ``` pub fn ok() {} -// @has bad_codeblock_syntax/fn.escape.html -// @has - '//*[@class="docblock"]' '\_ ' +//@ has bad_codeblock_syntax/fn.escape.html +//@ has - '//*[@class="docblock"]' '\_ ' /// ``` /// \_ /// /// ``` pub fn escape() {} -// @has bad_codeblock_syntax/fn.unterminated.html -// @has - '//*[@class="docblock"]' '"unterminated' +//@ has bad_codeblock_syntax/fn.unterminated.html +//@ has - '//*[@class="docblock"]' '"unterminated' /// ``` /// "unterminated /// ``` diff --git a/tests/rustdoc/blank-line-in-doc-block-47197.rs b/tests/rustdoc/blank-line-in-doc-block-47197.rs index 79492b4fa76..c35e6d2fe5c 100644 --- a/tests/rustdoc/blank-line-in-doc-block-47197.rs +++ b/tests/rustdoc/blank-line-in-doc-block-47197.rs @@ -1,7 +1,7 @@ // https://github.com/rust-lang/rust/issues/47197 #![crate_name="foo"] -// @has foo/fn.whose_woods_these_are_i_think_i_know.html +//@ has foo/fn.whose_woods_these_are_i_think_i_know.html /** * snow diff --git a/tests/rustdoc/blanket-impl-29503.rs b/tests/rustdoc/blanket-impl-29503.rs index d6a132e1c26..f43fe79ca58 100644 --- a/tests/rustdoc/blanket-impl-29503.rs +++ b/tests/rustdoc/blanket-impl-29503.rs @@ -3,12 +3,12 @@ use std::fmt; -// @has issue_29503/trait.MyTrait.html +//@ has issue_29503/trait.MyTrait.html pub trait MyTrait { fn my_string(&self) -> String; } -// @has - "//div[@id='implementors-list']//*[@id='impl-MyTrait-for-T']//h3[@class='code-header']" "impl MyTrait for Twhere T: Debug" +//@ has - "//div[@id='implementors-list']//*[@id='impl-MyTrait-for-T']//h3[@class='code-header']" "impl MyTrait for Twhere T: Debug" impl MyTrait for T where T: fmt::Debug, diff --git a/tests/rustdoc/blanket-impl-78673.rs b/tests/rustdoc/blanket-impl-78673.rs index d7ceef2c057..412d4057406 100644 --- a/tests/rustdoc/blanket-impl-78673.rs +++ b/tests/rustdoc/blanket-impl-78673.rs @@ -7,18 +7,18 @@ pub trait AnAmazingTrait {} impl AnAmazingTrait for T {} -// @has 'issue_78673/struct.MyStruct.html' -// @has - '//*[@class="impl"]' 'AnAmazingTrait for MyStruct' -// @!has - '//*[@class="impl"]' 'AnAmazingTrait for T' +//@ has 'issue_78673/struct.MyStruct.html' +//@ has - '//*[@class="impl"]' 'AnAmazingTrait for MyStruct' +//@ !has - '//*[@class="impl"]' 'AnAmazingTrait for T' pub struct MyStruct; impl AnAmazingTrait for MyStruct {} // generic structs may have _both_ specific and blanket impls that apply -// @has 'issue_78673/struct.AnotherStruct.html' -// @has - '//*[@class="impl"]' 'AnAmazingTrait for AnotherStruct<()>' -// @has - '//*[@class="impl"]' 'AnAmazingTrait for T' +//@ has 'issue_78673/struct.AnotherStruct.html' +//@ has - '//*[@class="impl"]' 'AnAmazingTrait for AnotherStruct<()>' +//@ has - '//*[@class="impl"]' 'AnAmazingTrait for T' pub struct AnotherStruct(T); impl Something for AnotherStruct {} diff --git a/tests/rustdoc/blanket-reexport-item.rs b/tests/rustdoc/blanket-reexport-item.rs index 315a38c30c5..199a47019a2 100644 --- a/tests/rustdoc/blanket-reexport-item.rs +++ b/tests/rustdoc/blanket-reexport-item.rs @@ -1,6 +1,6 @@ #![crate_name = "foo"] -// @has foo/struct.S.html '//*[@id="impl-Into%3CU%3E-for-T"]//h3[@class="code-header"]' 'impl Into for T' +//@ has foo/struct.S.html '//*[@id="impl-Into%3CU%3E-for-T"]//h3[@class="code-header"]' 'impl Into for T' pub struct S2 {} mod m { pub struct S {} diff --git a/tests/rustdoc/bounds.rs b/tests/rustdoc/bounds.rs index da09e3f2a52..8213ab96241 100644 --- a/tests/rustdoc/bounds.rs +++ b/tests/rustdoc/bounds.rs @@ -4,16 +4,16 @@ pub trait Eq {} pub trait Eq2 {} // Checking that "where predicates" and "generics params" are merged. -// @has 'foo/trait.T.html' -// @has - "//*[@id='tymethod.f']/h4" "fn f<'a, 'b, 'c, T>()where Self: Eq, T: Eq + 'a, 'c: 'b + 'a," +//@ has 'foo/trait.T.html' +//@ has - "//*[@id='tymethod.f']/h4" "fn f<'a, 'b, 'c, T>()where Self: Eq, T: Eq + 'a, 'c: 'b + 'a," pub trait T { fn f<'a, 'b, 'c: 'a, T: Eq + 'a>() where Self: Eq, Self: Eq, T: Eq, 'c: 'b; } // Checking that a duplicated "where predicate" is removed. -// @has 'foo/trait.T2.html' -// @has - "//*[@id='tymethod.f']/h4" "fn f()where Self: Eq + Eq2, T: Eq2 + Eq," +//@ has 'foo/trait.T2.html' +//@ has - "//*[@id='tymethod.f']/h4" "fn f()where Self: Eq + Eq2, T: Eq2 + Eq," pub trait T2 { fn f() where Self: Eq, Self: Eq2, T: Eq2; @@ -23,8 +23,8 @@ pub trait T2 { // Note that we don't want to hide them since they have a semantic effect. // For outlives-bounds, they force the lifetime param to be early-bound instead of late-bound. // For trait bounds, it can affect well-formedness (see `ClauseKind::WellFormed`). -// @has 'foo/fn.empty.html' -// @has - '//pre[@class="rust item-decl"]' "empty<'a, T>()where T:, 'a:," +//@ has 'foo/fn.empty.html' +//@ has - '//pre[@class="rust item-decl"]' "empty<'a, T>()where T:, 'a:," pub fn empty<'a, T>() where T:, diff --git a/tests/rustdoc/cap-lints.rs b/tests/rustdoc/cap-lints.rs index 08a35339680..30f9be0424c 100644 --- a/tests/rustdoc/cap-lints.rs +++ b/tests/rustdoc/cap-lints.rs @@ -3,7 +3,7 @@ // therefore should not concern itself with the lints. #[deny(warnings)] -// @has cap_lints/struct.Foo.html //* 'Foo' +//@ has cap_lints/struct.Foo.html //* 'Foo' pub struct Foo { field: i32, } diff --git a/tests/rustdoc/cfg-doctest.rs b/tests/rustdoc/cfg-doctest.rs index 6a9d26a4bb7..a2272e6ca00 100644 --- a/tests/rustdoc/cfg-doctest.rs +++ b/tests/rustdoc/cfg-doctest.rs @@ -1,5 +1,5 @@ -// @!has cfg_doctest/struct.SomeStruct.html -// @!has cfg_doctest/index.html '//a/@href' 'struct.SomeStruct.html' +//@ !has cfg_doctest/struct.SomeStruct.html +//@ !has cfg_doctest/index.html '//a/@href' 'struct.SomeStruct.html' /// Sneaky, this isn't actually part of docs. #[cfg(doctest)] diff --git a/tests/rustdoc/cfg_doc_reexport.rs b/tests/rustdoc/cfg_doc_reexport.rs index a10c84f2cac..a07e4fe2f02 100644 --- a/tests/rustdoc/cfg_doc_reexport.rs +++ b/tests/rustdoc/cfg_doc_reexport.rs @@ -4,14 +4,14 @@ #![crate_name = "foo"] #![no_core] -// @has 'foo/index.html' -// @has - '//*[@class="item-name"]/*[@class="stab portability"]' 'foobar' -// @has - '//*[@class="item-name"]/*[@class="stab portability"]' 'bar' +//@ has 'foo/index.html' +//@ has - '//*[@class="item-name"]/*[@class="stab portability"]' 'foobar' +//@ has - '//*[@class="item-name"]/*[@class="stab portability"]' 'bar' #[doc(cfg(feature = "foobar"))] mod imp_priv { - // @has 'foo/struct.BarPriv.html' - // @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ + //@ has 'foo/struct.BarPriv.html' + //@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available on crate feature foobar only.' pub struct BarPriv {} impl BarPriv { @@ -22,8 +22,8 @@ mod imp_priv { pub use crate::imp_priv::*; pub mod bar { - // @has 'foo/bar/struct.Bar.html' - // @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ + //@ has 'foo/bar/struct.Bar.html' + //@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available on crate feature bar only.' #[doc(cfg(feature = "bar"))] pub struct Bar; diff --git a/tests/rustdoc/check-source-code-urls-to-def-std.rs b/tests/rustdoc/check-source-code-urls-to-def-std.rs index fac2a94b815..42468f7dde6 100644 --- a/tests/rustdoc/check-source-code-urls-to-def-std.rs +++ b/tests/rustdoc/check-source-code-urls-to-def-std.rs @@ -2,14 +2,14 @@ #![crate_name = "foo"] -// @has 'src/foo/check-source-code-urls-to-def-std.rs.html' +//@ has 'src/foo/check-source-code-urls-to-def-std.rs.html' fn babar() {} -// @has - '//a[@href="{{channel}}/std/primitive.u32.html"]' 'u32' -// @has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'str' -// @has - '//a[@href="{{channel}}/std/primitive.bool.html"]' 'bool' -// @has - '//a[@href="#7"]' 'babar' +//@ has - '//a[@href="{{channel}}/std/primitive.u32.html"]' 'u32' +//@ has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'str' +//@ has - '//a[@href="{{channel}}/std/primitive.bool.html"]' 'bool' +//@ has - '//a[@href="#7"]' 'babar' pub fn foo(a: u32, b: &str, c: String) { let x = 12; let y: bool = true; @@ -31,12 +31,12 @@ macro_rules! data { pub fn another_foo() { // This is known limitation: if the macro doesn't generate anything, the visitor // can't find any item or anything that could tell us that it comes from expansion. - // @!has - '//a[@href="#19"]' 'yolo!' + //@ !has - '//a[@href="#19"]' 'yolo!' yolo!(); - // @has - '//a[@href="{{channel}}/std/macro.eprintln.html"]' 'eprintln!' + //@ has - '//a[@href="{{channel}}/std/macro.eprintln.html"]' 'eprintln!' eprintln!(); - // @has - '//a[@href="#27-29"]' 'data!' + //@ has - '//a[@href="#27-29"]' 'data!' let x = data!(4); - // @has - '//a[@href="#23-25"]' 'bar!' + //@ has - '//a[@href="#23-25"]' 'bar!' bar!(x); } diff --git a/tests/rustdoc/check-source-code-urls-to-def.rs b/tests/rustdoc/check-source-code-urls-to-def.rs index 30638992ac7..8703287abc5 100644 --- a/tests/rustdoc/check-source-code-urls-to-def.rs +++ b/tests/rustdoc/check-source-code-urls-to-def.rs @@ -8,16 +8,16 @@ extern crate source_code; -// @has 'src/foo/check-source-code-urls-to-def.rs.html' +//@ has 'src/foo/check-source-code-urls-to-def.rs.html' -// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#1-17"]' 'bar' +//@ has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#1-17"]' 'bar' #[path = "auxiliary/source-code-bar.rs"] pub mod bar; -// @count - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#5-7"]' 4 +//@ count - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#5-7"]' 4 use bar::Bar; -// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#13-17"]' 'self' -// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'Trait' +//@ has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#13-17"]' 'self' +//@ has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'Trait' use bar::sub::{self, Trait}; pub struct Foo; @@ -28,30 +28,30 @@ impl Foo { fn babar() {} -// @has - '//pre[@class="rust"]//a/@href' '/struct.String.html' -// @has - '//pre[@class="rust"]//a/@href' '/primitive.u32.html' -// @has - '//pre[@class="rust"]//a/@href' '/primitive.str.html' -// @count - '//pre[@class="rust"]//a[@href="#23"]' 5 -// @has - '//pre[@class="rust"]//a[@href="../../source_code/struct.SourceCode.html"]' \ +//@ has - '//pre[@class="rust"]//a/@href' '/struct.String.html' +//@ has - '//pre[@class="rust"]//a/@href' '/primitive.u32.html' +//@ has - '//pre[@class="rust"]//a/@href' '/primitive.str.html' +//@ count - '//pre[@class="rust"]//a[@href="#23"]' 5 +//@ has - '//pre[@class="rust"]//a[@href="../../source_code/struct.SourceCode.html"]' \ // 'source_code::SourceCode' pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::SourceCode) { let x = 12; let y: Foo = Foo; let z: Bar = bar::Bar { field: Foo }; babar(); - // @has - '//pre[@class="rust"]//a[@href="#26"]' 'hello' + //@ has - '//pre[@class="rust"]//a[@href="#26"]' 'hello' y.hello(); } -// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'bar::sub::Trait' -// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'Trait' +//@ has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'bar::sub::Trait' +//@ has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14-16"]' 'Trait' pub fn foo2(t: &T, v: &V, b: bool) {} pub trait AnotherTrait {} pub trait WhyNot {} -// @has - '//pre[@class="rust"]//a[@href="#50"]' 'AnotherTrait' -// @has - '//pre[@class="rust"]//a[@href="#51"]' 'WhyNot' +//@ has - '//pre[@class="rust"]//a[@href="#50"]' 'AnotherTrait' +//@ has - '//pre[@class="rust"]//a[@href="#51"]' 'WhyNot' pub fn foo3(t: &T, v: &V) where T: AnotherTrait, @@ -60,11 +60,11 @@ where pub trait AnotherTrait2 {} -// @has - '//pre[@class="rust"]//a[@href="#61"]' 'AnotherTrait2' +//@ has - '//pre[@class="rust"]//a[@href="#61"]' 'AnotherTrait2' pub fn foo4() { let x: Vec<&dyn AnotherTrait2> = Vec::new(); } -// @has - '//pre[@class="rust"]//a[@href="../../foo/primitive.bool.html"]' 'bool' +//@ has - '//pre[@class="rust"]//a[@href="../../foo/primitive.bool.html"]' 'bool' #[rustc_doc_primitive = "bool"] mod whatever {} diff --git a/tests/rustdoc/check-styled-link.rs b/tests/rustdoc/check-styled-link.rs index ed4a5ea2137..a74a3c9466f 100644 --- a/tests/rustdoc/check-styled-link.rs +++ b/tests/rustdoc/check-styled-link.rs @@ -2,7 +2,7 @@ pub struct Foo; -// @has foo/struct.Bar.html '//a[@href="struct.Foo.html"]' 'Foo' +//@ has foo/struct.Bar.html '//a[@href="struct.Foo.html"]' 'Foo' /// Code-styled reference to [`Foo`]. pub struct Bar; diff --git a/tests/rustdoc/check.rs b/tests/rustdoc/check.rs index 9ca85a123f7..c083e10f657 100644 --- a/tests/rustdoc/check.rs +++ b/tests/rustdoc/check.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Z unstable-options --check -// @!has check/fn.foo.html -// @!has check/index.html +//@ !has check/fn.foo.html +//@ !has check/index.html pub fn foo() {} diff --git a/tests/rustdoc/codeblock-title.rs b/tests/rustdoc/codeblock-title.rs index 761afb8bd08..22124869d6e 100644 --- a/tests/rustdoc/codeblock-title.rs +++ b/tests/rustdoc/codeblock-title.rs @@ -1,9 +1,9 @@ #![crate_name = "foo"] -// @has foo/fn.bar.html '//*[@class="example-wrap compile_fail"]/*[@class="tooltip"]' "ⓘ" -// @has foo/fn.bar.html '//*[@class="example-wrap ignore"]/*[@class="tooltip"]' "ⓘ" -// @has foo/fn.bar.html '//*[@class="example-wrap should_panic"]/*[@class="tooltip"]' "ⓘ" -// @has foo/fn.bar.html '//*[@title="This example runs with edition 2018"]' "ⓘ" +//@ has foo/fn.bar.html '//*[@class="example-wrap compile_fail"]/*[@class="tooltip"]' "ⓘ" +//@ has foo/fn.bar.html '//*[@class="example-wrap ignore"]/*[@class="tooltip"]' "ⓘ" +//@ has foo/fn.bar.html '//*[@class="example-wrap should_panic"]/*[@class="tooltip"]' "ⓘ" +//@ has foo/fn.bar.html '//*[@title="This example runs with edition 2018"]' "ⓘ" /// foo /// diff --git a/tests/rustdoc/compiler-derive-proc-macro.rs b/tests/rustdoc/compiler-derive-proc-macro.rs index 1c3867ced9b..e8dc5d7c6b7 100644 --- a/tests/rustdoc/compiler-derive-proc-macro.rs +++ b/tests/rustdoc/compiler-derive-proc-macro.rs @@ -2,14 +2,14 @@ #![crate_name = "foo"] -// @has 'foo/index.html' +//@ has 'foo/index.html' // Each compiler builtin proc-macro has a trait equivalent so we should have // a trait section as well. -// @count - '//*[@id="main-content"]//*[@class="section-header"]' 2 -// @has - '//*[@id="main-content"]//*[@class="section-header"]' 'Traits' -// @has - '//*[@id="main-content"]//*[@class="section-header"]' 'Derive Macros' +//@ count - '//*[@id="main-content"]//*[@class="section-header"]' 2 +//@ has - '//*[@id="main-content"]//*[@class="section-header"]' 'Traits' +//@ has - '//*[@id="main-content"]//*[@class="section-header"]' 'Derive Macros' // Now checking the correct file is generated as well. -// @has 'foo/derive.Clone.html' -// @!has 'foo/macro.Clone.html' +//@ has 'foo/derive.Clone.html' +//@ !has 'foo/macro.Clone.html' pub use std::clone::Clone; diff --git a/tests/rustdoc/const-display.rs b/tests/rustdoc/const-display.rs index 959a00102b7..ac55a6302f7 100644 --- a/tests/rustdoc/const-display.rs +++ b/tests/rustdoc/const-display.rs @@ -7,68 +7,68 @@ #![feature(foo, foo2)] #![feature(staged_api)] -// @has 'foo/fn.foo.html' '//pre' 'pub fn foo() -> u32' -// @has - '//span[@class="since"]' '1.0.0 (const: unstable)' +//@ has 'foo/fn.foo.html' '//pre' 'pub fn foo() -> u32' +//@ has - '//span[@class="since"]' '1.0.0 (const: unstable)' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature="foo", issue = "none")] pub const fn foo() -> u32 { 42 } -// @has 'foo/fn.foo_unsafe.html' '//pre' 'pub unsafe fn foo_unsafe() -> u32' -// @has - '//span[@class="since"]' '1.0.0 (const: unstable)' +//@ has 'foo/fn.foo_unsafe.html' '//pre' 'pub unsafe fn foo_unsafe() -> u32' +//@ has - '//span[@class="since"]' '1.0.0 (const: unstable)' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature="foo", issue = "none")] pub const unsafe fn foo_unsafe() -> u32 { 42 } -// @has 'foo/fn.foo2.html' '//pre' 'pub const fn foo2() -> u32' -// @!hasraw - '//span[@class="since"]' +//@ has 'foo/fn.foo2.html' '//pre' 'pub const fn foo2() -> u32' +//@ !hasraw - '//span[@class="since"]' #[unstable(feature = "humans", issue = "none")] pub const fn foo2() -> u32 { 42 } -// @has 'foo/fn.foo3.html' '//pre' 'pub const fn foo3() -> u32' -// @!hasraw - '//span[@class="since"]' +//@ has 'foo/fn.foo3.html' '//pre' 'pub const fn foo3() -> u32' +//@ !hasraw - '//span[@class="since"]' #[unstable(feature = "humans", issue = "none")] #[rustc_const_unstable(feature = "humans", issue = "none")] pub const fn foo3() -> u32 { 42 } -// @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32' -// @has - //span '1.0.0 (const: 1.0.0)' +//@ has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32' +//@ has - //span '1.0.0 (const: 1.0.0)' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] pub const fn bar2() -> u32 { 42 } -// @has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32' -// @!hasraw - '//span[@class="since"]' +//@ has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32' +//@ !hasraw - '//span[@class="since"]' #[unstable(feature = "foo2", issue = "none")] pub const unsafe fn foo2_gated() -> u32 { 42 } -// @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32' -// @has - '//span[@class="since"]' '1.0.0 (const: 1.0.0)' +//@ has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32' +//@ has - '//span[@class="since"]' '1.0.0 (const: 1.0.0)' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] pub const unsafe fn bar2_gated() -> u32 { 42 } -// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32' -// @!hasraw - '//span[@class="since"]' +//@ has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32' +//@ !hasraw - '//span[@class="since"]' pub const unsafe fn bar_not_gated() -> u32 { 42 } pub struct Foo; impl Foo { - // @has 'foo/struct.Foo.html' '//*[@id="method.gated"]/h4[@class="code-header"]' 'pub fn gated() -> u32' - // @has - '//span[@class="since"]' '1.0.0 (const: unstable)' + //@ has 'foo/struct.Foo.html' '//*[@id="method.gated"]/h4[@class="code-header"]' 'pub fn gated() -> u32' + //@ has - '//span[@class="since"]' '1.0.0 (const: unstable)' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature="foo", issue = "none")] pub const fn gated() -> u32 { 42 } - // @has 'foo/struct.Foo.html' '//*[@id="method.gated_unsafe"]/h4[@class="code-header"]' 'pub unsafe fn gated_unsafe() -> u32' - // @has - '//span[@class="since"]' '1.0.0 (const: unstable)' + //@ has 'foo/struct.Foo.html' '//*[@id="method.gated_unsafe"]/h4[@class="code-header"]' 'pub unsafe fn gated_unsafe() -> u32' + //@ has - '//span[@class="since"]' '1.0.0 (const: unstable)' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature="foo", issue = "none")] pub const unsafe fn gated_unsafe() -> u32 { 42 } - // @has 'foo/struct.Foo.html' '//*[@id="method.stable_impl"]/h4[@class="code-header"]' 'pub const fn stable_impl() -> u32' - // @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)' + //@ has 'foo/struct.Foo.html' '//*[@id="method.stable_impl"]/h4[@class="code-header"]' 'pub const fn stable_impl() -> u32' + //@ has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const2", since = "1.2.0")] pub const fn stable_impl() -> u32 { 42 } @@ -79,13 +79,13 @@ pub struct Bar; impl Bar { // Show non-const stabilities that are the same as the enclosing item. - // @has 'foo/struct.Bar.html' '//span[@class="since"]' '1.0.0 (const: 1.2.0)' + //@ has 'foo/struct.Bar.html' '//span[@class="since"]' '1.0.0 (const: 1.2.0)' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "const2", since = "1.2.0")] pub const fn stable_impl() -> u32 { 42 } // Show const-stability even for unstable functions. - // @matches 'foo/struct.Bar.html' '//span[@class="since"]' '^const: 1.3.0$' + //@ matches 'foo/struct.Bar.html' '//span[@class="since"]' '^const: 1.3.0$' #[unstable(feature = "foo2", issue = "none")] #[rustc_const_stable(feature = "const3", since = "1.3.0")] pub const fn const_stable_unstable() -> u32 { 42 } diff --git a/tests/rustdoc/const-doc.rs b/tests/rustdoc/const-doc.rs index 74ab4af61ac..f33083a267c 100644 --- a/tests/rustdoc/const-doc.rs +++ b/tests/rustdoc/const-doc.rs @@ -11,8 +11,8 @@ pub struct ContentType { } impl ContentType { - // @has const_doc/struct.ContentType.html - // @has - '//*[@id="associatedconstant.Any"]' 'const Any: ContentType' + //@ has const_doc/struct.ContentType.html + //@ has - '//*[@id="associatedconstant.Any"]' 'const Any: ContentType' pub const Any: ContentType = ContentType { ttype: Foo { f: PhantomData, }, subtype: Foo { f: PhantomData, }, params: None, }; diff --git a/tests/rustdoc/const-effect-param.rs b/tests/rustdoc/const-effect-param.rs index f3f1fcfda65..3c81700ba83 100644 --- a/tests/rustdoc/const-effect-param.rs +++ b/tests/rustdoc/const-effect-param.rs @@ -9,7 +9,7 @@ pub trait Tr { fn f(); } -// @has foo/fn.g.html -// @has - '//pre[@class="rust item-decl"]' 'pub const fn g()' +//@ has foo/fn.g.html +//@ has - '//pre[@class="rust item-decl"]' 'pub const fn g()' /// foo pub const fn g() {} diff --git a/tests/rustdoc/const-fn-76501.rs b/tests/rustdoc/const-fn-76501.rs index 4a7284f9851..fac49b0fd20 100644 --- a/tests/rustdoc/const-fn-76501.rs +++ b/tests/rustdoc/const-fn-76501.rs @@ -1,7 +1,7 @@ // https://github.com/rust-lang/rust/issues/76501 #![crate_name="foo"] -// @has 'foo/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32' +//@ has 'foo/fn.bloop.html' '//pre' 'pub const fn bloop() -> i32' /// A useless function that always returns 1. pub const fn bloop() -> i32 { 1 @@ -11,7 +11,7 @@ pub const fn bloop() -> i32 { pub struct Struct {} impl Struct { - // @has 'foo/struct.Struct.html' '//*[@class="method"]' \ + //@ has 'foo/struct.Struct.html' '//*[@class="method"]' \ // 'pub const fn blurp() -> i32' /// A useless function that always returns 1. pub const fn blurp() -> i32 { diff --git a/tests/rustdoc/const-fn-effects.rs b/tests/rustdoc/const-fn-effects.rs index c495a4faa87..4523870c8a5 100644 --- a/tests/rustdoc/const-fn-effects.rs +++ b/tests/rustdoc/const-fn-effects.rs @@ -2,15 +2,15 @@ #![feature(effects)] #![allow(incomplete_features)] -// @has foo/fn.bar.html -// @has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> ' +//@ has foo/fn.bar.html +//@ has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> ' /// foo pub const fn bar() -> usize { 2 } -// @has foo/struct.Foo.html -// @has - '//*[@class="method"]' 'const fn new()' +//@ has foo/struct.Foo.html +//@ has - '//*[@class="method"]' 'const fn new()' pub struct Foo(usize); impl Foo { diff --git a/tests/rustdoc/const-fn.rs b/tests/rustdoc/const-fn.rs index f6616185681..8cb0cb6bf1d 100644 --- a/tests/rustdoc/const-fn.rs +++ b/tests/rustdoc/const-fn.rs @@ -1,14 +1,14 @@ #![crate_name = "foo"] -// @has foo/fn.bar.html -// @has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> ' +//@ has foo/fn.bar.html +//@ has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> ' /// foo pub const fn bar() -> usize { 2 } -// @has foo/struct.Foo.html -// @has - '//*[@class="method"]' 'const fn new()' +//@ has foo/struct.Foo.html +//@ has - '//*[@class="method"]' 'const fn new()' pub struct Foo(usize); impl Foo { diff --git a/tests/rustdoc/const-generics/add-impl.rs b/tests/rustdoc/const-generics/add-impl.rs index df490d2c636..1fea0f847b2 100644 --- a/tests/rustdoc/const-generics/add-impl.rs +++ b/tests/rustdoc/const-generics/add-impl.rs @@ -2,12 +2,12 @@ use std::ops::Add; -// @has foo/struct.Simd.html '//pre[@class="rust item-decl"]' 'pub struct Simd' +//@ has foo/struct.Simd.html '//pre[@class="rust item-decl"]' 'pub struct Simd' pub struct Simd { inner: T, } -// @has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl Add for Simd' +//@ has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl Add for Simd' impl Add for Simd { type Output = Self; diff --git a/tests/rustdoc/const-generics/const-generic-defaults.rs b/tests/rustdoc/const-generics/const-generic-defaults.rs index 7a0a794112d..090f17cc988 100644 --- a/tests/rustdoc/const-generics/const-generic-defaults.rs +++ b/tests/rustdoc/const-generics/const-generic-defaults.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -// @has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \ +//@ has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \ // 'pub struct Foo(' pub struct Foo(T); diff --git a/tests/rustdoc/const-generics/const-generic-slice.rs b/tests/rustdoc/const-generics/const-generic-slice.rs index 80a9ab3f12e..6517caf4f2f 100644 --- a/tests/rustdoc/const-generics/const-generic-slice.rs +++ b/tests/rustdoc/const-generics/const-generic-slice.rs @@ -4,8 +4,8 @@ pub trait Array { type Item; } -// @has foo/trait.Array.html -// @has - '//*[@class="impl"]' 'impl Array for [T; N]' +//@ has foo/trait.Array.html +//@ has - '//*[@class="impl"]' 'impl Array for [T; N]' impl Array for [T; N] { type Item = T; } diff --git a/tests/rustdoc/const-generics/const-generics-docs.rs b/tests/rustdoc/const-generics/const-generics-docs.rs index 4ef1acf45f5..e261585263b 100644 --- a/tests/rustdoc/const-generics/const-generics-docs.rs +++ b/tests/rustdoc/const-generics/const-generics-docs.rs @@ -3,26 +3,26 @@ #![crate_name = "foo"] extern crate extern_crate; -// @has foo/fn.extern_fn.html '//pre[@class="rust item-decl"]' \ +//@ has foo/fn.extern_fn.html '//pre[@class="rust item-decl"]' \ // 'pub fn extern_fn() -> impl Iterator' pub use extern_crate::extern_fn; -// @has foo/struct.ExternTy.html '//pre[@class="rust item-decl"]' \ +//@ has foo/struct.ExternTy.html '//pre[@class="rust item-decl"]' \ // 'pub struct ExternTy {' pub use extern_crate::ExternTy; -// @has foo/type.TyAlias.html '//pre[@class="rust item-decl"]' \ +//@ has foo/type.TyAlias.html '//pre[@class="rust item-decl"]' \ // 'type TyAlias = ExternTy;' pub use extern_crate::TyAlias; -// @has foo/trait.WTrait.html '//pre[@class="rust item-decl"]' \ +//@ has foo/trait.WTrait.html '//pre[@class="rust item-decl"]' \ // 'pub trait WTrait' -// @has - '//pre[@class="rust item-decl"]' 'fn hey() -> usize' +//@ has - '//pre[@class="rust item-decl"]' 'fn hey() -> usize' pub use extern_crate::WTrait; -// @has foo/trait.Trait.html '//pre[@class="rust item-decl"]' \ +//@ has foo/trait.Trait.html '//pre[@class="rust item-decl"]' \ // 'pub trait Trait' -// @has - '//*[@id="impl-Trait%3C1%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<1> for u8' -// @has - '//*[@id="impl-Trait%3C2%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<2> for u8' -// @has - '//*[@id="impl-Trait%3C%7B1+%2B+2%7D%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<{1 + 2}> for u8' -// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8;+N%5D"]//h3[@class="code-header"]' \ +//@ has - '//*[@id="impl-Trait%3C1%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<1> for u8' +//@ has - '//*[@id="impl-Trait%3C2%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<2> for u8' +//@ has - '//*[@id="impl-Trait%3C%7B1+%2B+2%7D%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<{1 + 2}> for u8' +//@ has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8;+N%5D"]//h3[@class="code-header"]' \ // 'impl Trait for [u8; N]' pub trait Trait {} impl Trait<1> for u8 {} @@ -30,58 +30,58 @@ impl Trait<2> for u8 {} impl Trait<{1 + 2}> for u8 {} impl Trait for [u8; N] {} -// @has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \ +//@ has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \ // 'pub struct Foo where u8: Trait' pub struct Foo where u8: Trait; -// @has foo/struct.Bar.html '//pre[@class="rust item-decl"]' 'pub struct Bar(' +//@ has foo/struct.Bar.html '//pre[@class="rust item-decl"]' 'pub struct Bar(' pub struct Bar([T; N]); -// @has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header"]' 'impl Foowhere u8: Trait' +//@ has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header"]' 'impl Foowhere u8: Trait' impl Foo where u8: Trait { - // @has - '//*[@id="associatedconstant.FOO_ASSOC"]' 'pub const FOO_ASSOC: usize' + //@ has - '//*[@id="associatedconstant.FOO_ASSOC"]' 'pub const FOO_ASSOC: usize' pub const FOO_ASSOC: usize = M + 13; - // @has - '//*[@id="method.hey"]' 'pub fn hey(&self) -> Bar' + //@ has - '//*[@id="method.hey"]' 'pub fn hey(&self) -> Bar' pub fn hey(&self) -> Bar { Bar([0; N]) } } -// @has foo/struct.Bar.html '//*[@id="impl-Bar%3Cu8,+M%3E"]/h3[@class="code-header"]' 'impl Bar' +//@ has foo/struct.Bar.html '//*[@id="impl-Bar%3Cu8,+M%3E"]/h3[@class="code-header"]' 'impl Bar' impl Bar { - // @has - '//*[@id="method.hey"]' \ + //@ has - '//*[@id="method.hey"]' \ // 'pub fn hey(&self) -> Foowhere u8: Trait' pub fn hey(&self) -> Foo where u8: Trait { Foo } } -// @has foo/fn.test.html '//pre[@class="rust item-decl"]' \ +//@ has foo/fn.test.html '//pre[@class="rust item-decl"]' \ // 'pub fn test() -> impl Traitwhere u8: Trait' pub fn test() -> impl Trait where u8: Trait { 2u8 } -// @has foo/fn.a_sink.html '//pre[@class="rust item-decl"]' \ +//@ has foo/fn.a_sink.html '//pre[@class="rust item-decl"]' \ // 'pub async fn a_sink(v: [u8; N]) -> impl Trait' pub async fn a_sink(v: [u8; N]) -> impl Trait { v } -// @has foo/fn.b_sink.html '//pre[@class="rust item-decl"]' \ +//@ has foo/fn.b_sink.html '//pre[@class="rust item-decl"]' \ // 'pub async fn b_sink(_: impl Trait)' pub async fn b_sink(_: impl Trait) {} -// @has foo/fn.concrete.html '//pre[@class="rust item-decl"]' \ +//@ has foo/fn.concrete.html '//pre[@class="rust item-decl"]' \ // 'pub fn concrete() -> [u8; 22]' pub fn concrete() -> [u8; 3 + std::mem::size_of::() << 1] { Default::default() } -// @has foo/type.Faz.html '//pre[@class="rust item-decl"]' \ +//@ has foo/type.Faz.html '//pre[@class="rust item-decl"]' \ // 'type Faz = [u8; N];' pub type Faz = [u8; N]; -// @has foo/type.Fiz.html '//pre[@class="rust item-decl"]' \ +//@ has foo/type.Fiz.html '//pre[@class="rust item-decl"]' \ // 'type Fiz = [[u8; N]; 48];' pub type Fiz = [[u8; N]; 3 << 4]; @@ -91,7 +91,7 @@ macro_rules! define_me { } } -// @has foo/struct.Foz.html '//pre[@class="rust item-decl"]' \ +//@ has foo/struct.Foz.html '//pre[@class="rust item-decl"]' \ // 'pub struct Foz(/* private fields */);' define_me!(Foz); @@ -103,26 +103,26 @@ impl Q for [u8; N] { const ASSOC: usize = N; } -// @has foo/fn.q_user.html '//pre[@class="rust item-decl"]' \ +//@ has foo/fn.q_user.html '//pre[@class="rust item-decl"]' \ // 'pub fn q_user() -> [u8; 13]' pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] { [0; <[u8; 13] as Q>::ASSOC] } -// @has foo/union.Union.html '//pre[@class="rust item-decl"]' \ +//@ has foo/union.Union.html '//pre[@class="rust item-decl"]' \ // 'pub union Union' pub union Union { - // @has - //pre "pub arr: [u8; N]" + //@ has - //pre "pub arr: [u8; N]" pub arr: [u8; N], - // @has - //pre "pub another_arr: [(); N]" + //@ has - //pre "pub another_arr: [(); N]" pub another_arr: [(); N], } -// @has foo/enum.Enum.html '//pre[@class="rust item-decl"]' \ +//@ has foo/enum.Enum.html '//pre[@class="rust item-decl"]' \ // 'pub enum Enum' pub enum Enum { - // @has - //pre "Variant([u8; N])" + //@ has - //pre "Variant([u8; N])" Variant([u8; N]), - // @has - //pre "EmptyVariant" + //@ has - //pre "EmptyVariant" EmptyVariant, } diff --git a/tests/rustdoc/const-generics/const-impl.rs b/tests/rustdoc/const-generics/const-impl.rs index f4eefcc1c33..ce536291290 100644 --- a/tests/rustdoc/const-generics/const-impl.rs +++ b/tests/rustdoc/const-generics/const-impl.rs @@ -10,21 +10,21 @@ pub enum Order { Unsorted, } -// @has foo/struct.VSet.html '//pre[@class="rust item-decl"]' 'pub struct VSet' -// @has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl Send for VSet' -// @has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl Sync for VSet' +//@ has foo/struct.VSet.html '//pre[@class="rust item-decl"]' 'pub struct VSet' +//@ has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl Send for VSet' +//@ has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl Sync for VSet' pub struct VSet { inner: Vec, } -// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Sorted+%7D%3E"]/h3[@class="code-header"]' 'impl VSet' +//@ has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Sorted+%7D%3E"]/h3[@class="code-header"]' 'impl VSet' impl VSet { pub fn new() -> Self { Self { inner: Vec::new() } } } -// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Unsorted+%7D%3E"]/h3[@class="code-header"]' 'impl VSet' +//@ has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Unsorted+%7D%3E"]/h3[@class="code-header"]' 'impl VSet' impl VSet { pub fn new() -> Self { Self { inner: Vec::new() } @@ -33,7 +33,7 @@ impl VSet { pub struct Escape; -// @has foo/struct.Escape.html '//*[@id="impl-Escape%3C%22%3Cscript%3Ealert(%5C%22Escape%5C%22);%3C/script%3E%22%3E"]/h3[@class="code-header"]' 'impl Escapealert("Escape");"#>' +//@ has foo/struct.Escape.html '//*[@id="impl-Escape%3C%22%3Cscript%3Ealert(%5C%22Escape%5C%22);%3C/script%3E%22%3E"]/h3[@class="code-header"]' 'impl Escapealert("Escape");"#>' impl Escapealert("Escape");"#> { pub fn f() {} } diff --git a/tests/rustdoc/const-generics/generic_const_exprs.rs b/tests/rustdoc/const-generics/generic_const_exprs.rs index 2d2d31d7231..c406fa5d034 100644 --- a/tests/rustdoc/const-generics/generic_const_exprs.rs +++ b/tests/rustdoc/const-generics/generic_const_exprs.rs @@ -2,6 +2,6 @@ #![feature(generic_const_exprs)] #![allow(incomplete_features)] // make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647 -// @has foo/struct.Ice.html '//pre[@class="rust item-decl"]' \ +//@ has foo/struct.Ice.html '//pre[@class="rust item-decl"]' \ // 'pub struct Ice where [(); { _ }]:;' pub struct Ice where [(); N + 1]:; diff --git a/tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs b/tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs index 310e89a35c4..c9d80d68aa1 100644 --- a/tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs +++ b/tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs @@ -11,8 +11,8 @@ pub struct Hasher { unsafe impl Send for Hasher {} -// @has foo/struct.Foo.html -// @has - '//h3[@class="code-header"]' 'impl Send for Foo' +//@ has foo/struct.Foo.html +//@ has - '//h3[@class="code-header"]' 'impl Send for Foo' pub struct Foo { hasher: Hasher<[u8; 3]>, } diff --git a/tests/rustdoc/const-generics/type-alias.rs b/tests/rustdoc/const-generics/type-alias.rs index 4b93e72d273..6d98648fe62 100644 --- a/tests/rustdoc/const-generics/type-alias.rs +++ b/tests/rustdoc/const-generics/type-alias.rs @@ -1,4 +1,4 @@ #![crate_name = "foo"] -// @has foo/type.CellIndex.html '//pre[@class="rust item-decl"]' 'type CellIndex = [i64; D];' +//@ has foo/type.CellIndex.html '//pre[@class="rust item-decl"]' 'type CellIndex = [i64; D];' pub type CellIndex = [i64; D]; diff --git a/tests/rustdoc/const-intrinsic.rs b/tests/rustdoc/const-intrinsic.rs index 6d2c6cce29c..520e253469c 100644 --- a/tests/rustdoc/const-intrinsic.rs +++ b/tests/rustdoc/const-intrinsic.rs @@ -5,21 +5,21 @@ #![stable(since="1.0.0", feature="rust1")] extern "rust-intrinsic" { - // @has 'foo/fn.transmute.html' - // @has - '//pre[@class="rust item-decl"]' 'pub const unsafe extern "rust-intrinsic" fn transmute(_: T) -> U' + //@ has 'foo/fn.transmute.html' + //@ has - '//pre[@class="rust item-decl"]' 'pub const unsafe extern "rust-intrinsic" fn transmute(_: T) -> U' #[stable(since="1.0.0", feature="rust1")] #[rustc_const_stable(feature = "const_transmute", since = "1.56.0")] pub fn transmute(_: T) -> U; - // @has 'foo/fn.unreachable.html' - // @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !' + //@ has 'foo/fn.unreachable.html' + //@ has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !' #[stable(since="1.0.0", feature="rust1")] pub fn unreachable() -> !; } extern "C" { - // @has 'foo/fn.needs_drop.html' - // @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn needs_drop() -> !' + //@ has 'foo/fn.needs_drop.html' + //@ has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn needs_drop() -> !' #[stable(since="1.0.0", feature="rust1")] pub fn needs_drop() -> !; } diff --git a/tests/rustdoc/const-rendering-macros-33302.rs b/tests/rustdoc/const-rendering-macros-33302.rs index 0f5cb921411..9fd45df08be 100644 --- a/tests/rustdoc/const-rendering-macros-33302.rs +++ b/tests/rustdoc/const-rendering-macros-33302.rs @@ -8,42 +8,42 @@ macro_rules! make { ($n:expr) => { pub struct S; - // @has issue_33302/constant.CST.html \ + //@ has issue_33302/constant.CST.html \ // '//pre[@class="rust item-decl"]' 'pub const CST: i32' pub const CST: i32 = ($n * $n); - // @has issue_33302/static.ST.html \ + //@ has issue_33302/static.ST.html \ // '//pre[@class="rust item-decl"]' 'pub static ST: i32' pub static ST: i32 = ($n * $n); pub trait T { fn ignore(_: &X) {} const C: X; - // @has issue_33302/trait.T.html \ + //@ has issue_33302/trait.T.html \ // '//pre[@class="rust item-decl"]' 'const D: i32' - // @has - '//*[@id="associatedconstant.D"]' 'const D: i32' + //@ has - '//*[@id="associatedconstant.D"]' 'const D: i32' const D: i32 = ($n * $n); } - // @has issue_33302/struct.S.html \ + //@ has issue_33302/struct.S.html \ // '//*[@class="impl"]' 'impl T<[i32; 16]> for S' - // @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]' - // @has - '//*[@id="associatedconstant.D"]' 'const D: i32' + //@ has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]' + //@ has - '//*[@id="associatedconstant.D"]' 'const D: i32' impl T<[i32; ($n * $n)]> for S { const C: [i32; ($n * $n)] = [0; ($n * $n)]; } - // @has issue_33302/struct.S.html \ + //@ has issue_33302/struct.S.html \ // '//*[@class="impl"]' 'impl T<[i32; 16]> for S' - // @has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)' - // @has - '//*[@id="associatedconstant.D-1"]' 'const D: i32' + //@ has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)' + //@ has - '//*[@id="associatedconstant.D-1"]' 'const D: i32' impl T<(i32,)> for S { const C: (i32,) = ($n,); } - // @has issue_33302/struct.S.html \ + //@ has issue_33302/struct.S.html \ // '//*[@class="impl"]' 'impl T<(i32, i32)> for S' - // @has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)' - // @has - '//*[@id="associatedconstant.D-2"]' 'const D: i32' + //@ has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)' + //@ has - '//*[@id="associatedconstant.D-2"]' 'const D: i32' impl T<(i32, i32)> for S { const C: (i32, i32) = ($n, $n); const D: i32 = ($n / $n); diff --git a/tests/rustdoc/const-underscore.rs b/tests/rustdoc/const-underscore.rs index f7f15e54831..fafc4b4e25c 100644 --- a/tests/rustdoc/const-underscore.rs +++ b/tests/rustdoc/const-underscore.rs @@ -1,6 +1,6 @@ //@ compile-flags: --document-private-items -// @!has const_underscore/constant._.html +//@ !has const_underscore/constant._.html const _: () = { #[no_mangle] extern "C" fn implementation_detail() {} diff --git a/tests/rustdoc/const-value-display.rs b/tests/rustdoc/const-value-display.rs index a7548ad2cc4..658978a3490 100644 --- a/tests/rustdoc/const-value-display.rs +++ b/tests/rustdoc/const-value-display.rs @@ -1,9 +1,9 @@ #![crate_name = "foo"] -// @has 'foo/constant.HOUR_IN_SECONDS.html' -// @has - '//*[@class="rust item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64' +//@ has 'foo/constant.HOUR_IN_SECONDS.html' +//@ has - '//*[@class="rust item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64' pub const HOUR_IN_SECONDS: u64 = 60 * 60; -// @has 'foo/constant.NEGATIVE.html' -// @has - '//*[@class="rust item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64' +//@ has 'foo/constant.NEGATIVE.html' +//@ has - '//*[@class="rust item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64' pub const NEGATIVE: i64 = -60 * 60; diff --git a/tests/rustdoc/const.rs b/tests/rustdoc/const.rs index 587ad4db478..fe6a828505a 100644 --- a/tests/rustdoc/const.rs +++ b/tests/rustdoc/const.rs @@ -3,7 +3,7 @@ pub struct Foo; impl Foo { - // @has const/struct.Foo.html '//*[@id="method.new"]//h4[@class="code-header"]' 'const unsafe fn new' + //@ has const/struct.Foo.html '//*[@id="method.new"]//h4[@class="code-header"]' 'const unsafe fn new' pub const unsafe fn new() -> Foo { Foo } diff --git a/tests/rustdoc/constructor-imports.rs b/tests/rustdoc/constructor-imports.rs index 26795c27444..e5f280476b6 100644 --- a/tests/rustdoc/constructor-imports.rs +++ b/tests/rustdoc/constructor-imports.rs @@ -7,9 +7,9 @@ pub mod a { } } -// @count 'foo/index.html' '//*[code="pub use a::Foo;"]' 1 +//@ count 'foo/index.html' '//*[code="pub use a::Foo;"]' 1 #[doc(no_inline)] pub use a::Foo; -// @count 'foo/index.html' '//*[code="pub use a::Bar::Baz;"]' 1 +//@ count 'foo/index.html' '//*[code="pub use a::Bar::Baz;"]' 1 #[doc(no_inline)] pub use a::Bar::Baz; diff --git a/tests/rustdoc/crate-version-escape.rs b/tests/rustdoc/crate-version-escape.rs index a8f9e7eee7b..3a08d52361c 100644 --- a/tests/rustdoc/crate-version-escape.rs +++ b/tests/rustdoc/crate-version-escape.rs @@ -2,4 +2,4 @@ #![crate_name = "foo"] -// @has 'foo/index.html' '//*[@class="version"]' '' +//@ has 'foo/index.html' '//*[@class="version"]' '' diff --git a/tests/rustdoc/crate-version-extra.rs b/tests/rustdoc/crate-version-extra.rs index 4e215b86dee..b3cd54da764 100644 --- a/tests/rustdoc/crate-version-extra.rs +++ b/tests/rustdoc/crate-version-extra.rs @@ -3,5 +3,5 @@ #![crate_name="foo"] // main version next to logo, extra version data below it -// @has 'foo/index.html' '//h2/span[@class="version"]' '1.3.37-nightly' -// @has 'foo/index.html' '//nav[@class="sidebar"]/div[@class="version"]' '(203c57dbe 2023-09-17)' +//@ has 'foo/index.html' '//h2/span[@class="version"]' '1.3.37-nightly' +//@ has 'foo/index.html' '//nav[@class="sidebar"]/div[@class="version"]' '(203c57dbe 2023-09-17)' diff --git a/tests/rustdoc/crate-version.rs b/tests/rustdoc/crate-version.rs index 7095bf54c13..05ce0aeb5ca 100644 --- a/tests/rustdoc/crate-version.rs +++ b/tests/rustdoc/crate-version.rs @@ -1,3 +1,3 @@ //@ compile-flags: --crate-version=1.3.37 -// @has 'crate_version/index.html' '//*[@class="version"]' '1.3.37' +//@ has 'crate_version/index.html' '//*[@class="version"]' '1.3.37' diff --git a/tests/rustdoc/cross-crate-hidden-assoc-trait-items.rs b/tests/rustdoc/cross-crate-hidden-assoc-trait-items.rs index 22630705e1e..d3771c2e7a2 100644 --- a/tests/rustdoc/cross-crate-hidden-assoc-trait-items.rs +++ b/tests/rustdoc/cross-crate-hidden-assoc-trait-items.rs @@ -10,14 +10,14 @@ // visible items instead and assert that there are *exactly two* associated items // (by counting the number of `section`s). This is more robust and future-proof. -// @has dependent/struct.Ty.html -// @has - '//*[@id="associatedtype.VisibleAssoc"]' 'type VisibleAssoc = ()' -// @has - '//*[@id="associatedconstant.VISIBLE_ASSOC"]' 'const VISIBLE_ASSOC: ()' -// @count - '//*[@class="impl-items"]/section' 2 +//@ has dependent/struct.Ty.html +//@ has - '//*[@id="associatedtype.VisibleAssoc"]' 'type VisibleAssoc = ()' +//@ has - '//*[@id="associatedconstant.VISIBLE_ASSOC"]' 'const VISIBLE_ASSOC: ()' +//@ count - '//*[@class="impl-items"]/section' 2 -// @has dependent/trait.Tr.html -// @has - '//*[@id="associatedtype.VisibleAssoc-1"]' 'type VisibleAssoc = ()' -// @has - '//*[@id="associatedconstant.VISIBLE_ASSOC-1"]' 'const VISIBLE_ASSOC: ()' -// @count - '//*[@class="impl-items"]/section' 2 +//@ has dependent/trait.Tr.html +//@ has - '//*[@id="associatedtype.VisibleAssoc-1"]' 'type VisibleAssoc = ()' +//@ has - '//*[@id="associatedconstant.VISIBLE_ASSOC-1"]' 'const VISIBLE_ASSOC: ()' +//@ count - '//*[@class="impl-items"]/section' 2 pub use dependency::{Tr, Ty}; diff --git a/tests/rustdoc/cross-crate-hidden-impl-parameter.rs b/tests/rustdoc/cross-crate-hidden-impl-parameter.rs index 69f9ca132fd..ebfe251134a 100644 --- a/tests/rustdoc/cross-crate-hidden-impl-parameter.rs +++ b/tests/rustdoc/cross-crate-hidden-impl-parameter.rs @@ -8,7 +8,7 @@ pub use ::cross_crate_hidden_impl_parameter::{HiddenType, HiddenTrait}; // OK, n pub enum MyLibType {} -// @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CHiddenType%3E"]' 'impl From for MyLibType' +//@ !has foo/enum.MyLibType.html '//*[@id="impl-From%3CHiddenType%3E"]' 'impl From for MyLibType' impl From for MyLibType { fn from(it: HiddenType) -> MyLibType { match it {} @@ -17,17 +17,17 @@ impl From for MyLibType { pub struct T(T); -// @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From>>>> for MyLibType' +//@ !has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From>>>> for MyLibType' impl From>>>> for MyLibType { fn from(it: T>>>) -> MyLibType { todo!() } } -// @!has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType' +//@ !has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType' impl HiddenTrait for MyLibType {} -// @!has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From for T>>>' +//@ !has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From for T>>>' impl From for T>>> { fn from(it: MyLibType) -> T>>> { match it {} diff --git a/tests/rustdoc/cross-crate-links.rs b/tests/rustdoc/cross-crate-links.rs index 36e8f31dfc6..b051d41cad4 100644 --- a/tests/rustdoc/cross-crate-links.rs +++ b/tests/rustdoc/cross-crate-links.rs @@ -6,54 +6,54 @@ #[macro_use] extern crate all_item_types; -// @has 'foo/index.html' '//a[@href="../all_item_types/foo_mod/index.html"]' 'foo_mod' +//@ has 'foo/index.html' '//a[@href="../all_item_types/foo_mod/index.html"]' 'foo_mod' #[doc(no_inline)] pub use all_item_types::foo_mod; -// @has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_ffn.html"]' 'foo_ffn' +//@ has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_ffn.html"]' 'foo_ffn' #[doc(no_inline)] pub use all_item_types::foo_ffn; -// @has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_FSTATIC.html"]' 'FOO_FSTATIC' +//@ has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_FSTATIC.html"]' 'FOO_FSTATIC' #[doc(no_inline)] pub use all_item_types::FOO_FSTATIC; -// @has 'foo/index.html' '//a[@href="../all_item_types/foreigntype.FooFType.html"]' 'FooFType' +//@ has 'foo/index.html' '//a[@href="../all_item_types/foreigntype.FooFType.html"]' 'FooFType' #[doc(no_inline)] pub use all_item_types::FooFType; -// @has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_fn.html"]' 'foo_fn' +//@ has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_fn.html"]' 'foo_fn' #[doc(no_inline)] pub use all_item_types::foo_fn; -// @has 'foo/index.html' '//a[@href="../all_item_types/trait.FooTrait.html"]' 'FooTrait' +//@ has 'foo/index.html' '//a[@href="../all_item_types/trait.FooTrait.html"]' 'FooTrait' #[doc(no_inline)] pub use all_item_types::FooTrait; -// @has 'foo/index.html' '//a[@href="../all_item_types/struct.FooStruct.html"]' 'FooStruct' +//@ has 'foo/index.html' '//a[@href="../all_item_types/struct.FooStruct.html"]' 'FooStruct' #[doc(no_inline)] pub use all_item_types::FooStruct; -// @has 'foo/index.html' '//a[@href="../all_item_types/enum.FooEnum.html"]' 'FooEnum' +//@ has 'foo/index.html' '//a[@href="../all_item_types/enum.FooEnum.html"]' 'FooEnum' #[doc(no_inline)] pub use all_item_types::FooEnum; -// @has 'foo/index.html' '//a[@href="../all_item_types/union.FooUnion.html"]' 'FooUnion' +//@ has 'foo/index.html' '//a[@href="../all_item_types/union.FooUnion.html"]' 'FooUnion' #[doc(no_inline)] pub use all_item_types::FooUnion; -// @has 'foo/index.html' '//a[@href="../all_item_types/type.FooType.html"]' 'FooType' +//@ has 'foo/index.html' '//a[@href="../all_item_types/type.FooType.html"]' 'FooType' #[doc(no_inline)] pub use all_item_types::FooType; -// @has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_STATIC.html"]' 'FOO_STATIC' +//@ has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_STATIC.html"]' 'FOO_STATIC' #[doc(no_inline)] pub use all_item_types::FOO_STATIC; -// @has 'foo/index.html' '//a[@href="../all_item_types/constant.FOO_CONSTANT.html"]' 'FOO_CONSTANT' +//@ has 'foo/index.html' '//a[@href="../all_item_types/constant.FOO_CONSTANT.html"]' 'FOO_CONSTANT' #[doc(no_inline)] pub use all_item_types::FOO_CONSTANT; -// @has 'foo/index.html' '//a[@href="../all_item_types/macro.foo_macro.html"]' 'foo_macro' +//@ has 'foo/index.html' '//a[@href="../all_item_types/macro.foo_macro.html"]' 'foo_macro' #[doc(no_inline)] pub use all_item_types::foo_macro; diff --git a/tests/rustdoc/cross-crate-primitive-doc.rs b/tests/rustdoc/cross-crate-primitive-doc.rs index 01a4c4ef8e4..ca33dedcbae 100644 --- a/tests/rustdoc/cross-crate-primitive-doc.rs +++ b/tests/rustdoc/cross-crate-primitive-doc.rs @@ -7,7 +7,7 @@ extern crate primitive_doc; -// @has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'usize' -// @has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'link' +//@ has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'usize' +//@ has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'link' /// [link](usize) pub fn foo() -> usize { 0 } diff --git a/tests/rustdoc/custom_code_classes.rs b/tests/rustdoc/custom_code_classes.rs index 569857a09cb..1e89b0761a6 100644 --- a/tests/rustdoc/custom_code_classes.rs +++ b/tests/rustdoc/custom_code_classes.rs @@ -4,10 +4,10 @@ #![feature(no_core)] #![no_core] -// @has 'foo/struct.Bar.html' -// @has - '//*[@id="main-content"]//pre[@class="language-whatever hoho-c"]' 'main;' -// @has - '//*[@id="main-content"]//pre[@class="language-whatever2 haha-c"]' 'main;' -// @has - '//*[@id="main-content"]//pre[@class="language-whatever4 huhu-c"]' 'main;' +//@ has 'foo/struct.Bar.html' +//@ has - '//*[@id="main-content"]//pre[@class="language-whatever hoho-c"]' 'main;' +//@ has - '//*[@id="main-content"]//pre[@class="language-whatever2 haha-c"]' 'main;' +//@ has - '//*[@id="main-content"]//pre[@class="language-whatever4 huhu-c"]' 'main;' /// ```{class=hoho-c},whatever /// main; diff --git a/tests/rustdoc/decl-line-wrapping-empty-arg-list.rs b/tests/rustdoc/decl-line-wrapping-empty-arg-list.rs index 4cfb87496b4..635c7762a53 100644 --- a/tests/rustdoc/decl-line-wrapping-empty-arg-list.rs +++ b/tests/rustdoc/decl-line-wrapping-empty-arg-list.rs @@ -5,8 +5,8 @@ pub struct Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000; -// @has 'decl_line_wrapping_empty_arg_list/fn.create.html' -// @snapshot decl - '//pre[@class="rust item-decl"]' +//@ has 'decl_line_wrapping_empty_arg_list/fn.create.html' +//@ snapshot decl - '//pre[@class="rust item-decl"]' pub fn create() -> Padding00000000000000000000000000000000000000000000000000000000000000000000000000000000 { loop {} } diff --git a/tests/rustdoc/decl-trailing-whitespace.rs b/tests/rustdoc/decl-trailing-whitespace.rs index 66783774308..9fa01f3216c 100644 --- a/tests/rustdoc/decl-trailing-whitespace.rs +++ b/tests/rustdoc/decl-trailing-whitespace.rs @@ -4,10 +4,10 @@ pub struct Error; -// @has 'foo/trait.Write.html' +//@ has 'foo/trait.Write.html' pub trait Write { - // @snapshot 'declaration' - '//*[@class="rust item-decl"]//code' + //@ snapshot 'declaration' - '//*[@class="rust item-decl"]//code' fn poll_write( self, cx: &mut Option, diff --git a/tests/rustdoc/decl_macro.rs b/tests/rustdoc/decl_macro.rs index 116fa15d749..da471e7c224 100644 --- a/tests/rustdoc/decl_macro.rs +++ b/tests/rustdoc/decl_macro.rs @@ -2,25 +2,25 @@ #![feature(decl_macro)] -// @has decl_macro/macro.my_macro.html //pre 'pub macro my_macro() {' -// @has - //pre '...' -// @has - //pre '}' +//@ has decl_macro/macro.my_macro.html //pre 'pub macro my_macro() {' +//@ has - //pre '...' +//@ has - //pre '}' pub macro my_macro() { } -// @has decl_macro/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {' -// @has - //pre '...' -// @has - //pre '}' +//@ has decl_macro/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {' +//@ has - //pre '...' +//@ has - //pre '}' pub macro my_macro_2($($tok:tt)*) { } -// @has decl_macro/macro.my_macro_multi.html //pre 'pub macro my_macro_multi {' -// @has - //pre '(_) => { ... },' -// @has - //pre '($foo:ident . $bar:expr) => { ... },' -// @has - //pre '($($foo:literal),+) => { ... },' -// @has - //pre '}' +//@ has decl_macro/macro.my_macro_multi.html //pre 'pub macro my_macro_multi {' +//@ has - //pre '(_) => { ... },' +//@ has - //pre '($foo:ident . $bar:expr) => { ... },' +//@ has - //pre '($($foo:literal),+) => { ... },' +//@ has - //pre '}' pub macro my_macro_multi { (_) => { @@ -33,21 +33,21 @@ pub macro my_macro_multi { } } -// @has decl_macro/macro.by_example_single.html //pre 'pub macro by_example_single($foo:expr) {' -// @has - //pre '...' -// @has - //pre '}' +//@ has decl_macro/macro.by_example_single.html //pre 'pub macro by_example_single($foo:expr) {' +//@ has - //pre '...' +//@ has - //pre '}' pub macro by_example_single { ($foo:expr) => {} } mod a { mod b { - // @has decl_macro/a/b/macro.by_example_vis.html //pre 'pub(super) macro by_example_vis($foo:expr) {' + //@ has decl_macro/a/b/macro.by_example_vis.html //pre 'pub(super) macro by_example_vis($foo:expr) {' pub(in super) macro by_example_vis { ($foo:expr) => {} } mod c { - // @has decl_macro/a/b/c/macro.by_example_vis_named.html //pre 'pub(in a) macro by_example_vis_named($foo:expr) {' + //@ has decl_macro/a/b/c/macro.by_example_vis_named.html //pre 'pub(in a) macro by_example_vis_named($foo:expr) {' pub(in a) macro by_example_vis_named { ($foo:expr) => {} } diff --git a/tests/rustdoc/decl_macro_priv.rs b/tests/rustdoc/decl_macro_priv.rs index 2a890e739f2..d87c8d22f2d 100644 --- a/tests/rustdoc/decl_macro_priv.rs +++ b/tests/rustdoc/decl_macro_priv.rs @@ -2,13 +2,13 @@ #![feature(decl_macro)] -// @has decl_macro_priv/macro.crate_macro.html //pre 'pub(crate) macro crate_macro() {' -// @has - //pre '...' -// @has - //pre '}' +//@ has decl_macro_priv/macro.crate_macro.html //pre 'pub(crate) macro crate_macro() {' +//@ has - //pre '...' +//@ has - //pre '}' pub(crate) macro crate_macro() {} -// @has decl_macro_priv/macro.priv_macro.html //pre 'macro priv_macro() {' -// @!has - //pre 'pub macro priv_macro() {' -// @has - //pre '...' -// @has - //pre '}' +//@ has decl_macro_priv/macro.priv_macro.html //pre 'macro priv_macro() {' +//@ !has - //pre 'pub macro priv_macro() {' +//@ has - //pre '...' +//@ has - //pre '}' macro priv_macro() {} diff --git a/tests/rustdoc/deduplicate-glob-import-impl-21474.rs b/tests/rustdoc/deduplicate-glob-import-impl-21474.rs index 2a675b4b6ef..5812d414997 100644 --- a/tests/rustdoc/deduplicate-glob-import-impl-21474.rs +++ b/tests/rustdoc/deduplicate-glob-import-impl-21474.rs @@ -9,6 +9,6 @@ mod inner { pub trait Blah { } -// @count issue_21474/struct.What.html \ +//@ count issue_21474/struct.What.html \ // '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1 pub struct What; diff --git a/tests/rustdoc/default-theme.rs b/tests/rustdoc/default-theme.rs index 4167086807c..529b994c3c2 100644 --- a/tests/rustdoc/default-theme.rs +++ b/tests/rustdoc/default-theme.rs @@ -1,7 +1,7 @@ //@ compile-flags: --default-theme ayu -// @has default_theme/index.html -// @has - '//script[@id="default-settings"]/@data-theme' 'ayu' -// @has - '//script[@id="default-settings"]/@data-use_system_theme' 'false' +//@ has default_theme/index.html +//@ has - '//script[@id="default-settings"]/@data-theme' 'ayu' +//@ has - '//script[@id="default-settings"]/@data-use_system_theme' 'false' pub fn whatever() {} diff --git a/tests/rustdoc/default-trait-method-link.rs b/tests/rustdoc/default-trait-method-link.rs index 7bcd2a3c149..3e03ecece97 100644 --- a/tests/rustdoc/default-trait-method-link.rs +++ b/tests/rustdoc/default-trait-method-link.rs @@ -1,7 +1,7 @@ #![crate_name = "foo"] -// @has foo/trait.Foo.html '//a[@href="trait.Foo.html#tymethod.req"]' 'req' -// @has foo/trait.Foo.html '//a[@href="trait.Foo.html#method.prov"]' 'prov' +//@ has foo/trait.Foo.html '//a[@href="trait.Foo.html#tymethod.req"]' 'req' +//@ has foo/trait.Foo.html '//a[@href="trait.Foo.html#method.prov"]' 'prov' /// Always make sure to implement [`req`], but you don't have to implement [`prov`]. /// diff --git a/tests/rustdoc/default-trait-method.rs b/tests/rustdoc/default-trait-method.rs index c8950678164..5a1d256e906 100644 --- a/tests/rustdoc/default-trait-method.rs +++ b/tests/rustdoc/default-trait-method.rs @@ -1,45 +1,45 @@ #![feature(min_specialization)] -// @has default_trait_method/trait.Item.html +//@ has default_trait_method/trait.Item.html pub trait Item { - // @has - '//*[@id="tymethod.foo"]' 'fn foo()' - // @!has - '//*[@id="tymethod.foo"]' 'default fn foo()' + //@ has - '//*[@id="tymethod.foo"]' 'fn foo()' + //@ !has - '//*[@id="tymethod.foo"]' 'default fn foo()' fn foo(); - // @has - '//*[@id="tymethod.bar"]' 'fn bar()' - // @!has - '//*[@id="tymethod.bar"]' 'default fn bar()' + //@ has - '//*[@id="tymethod.bar"]' 'fn bar()' + //@ !has - '//*[@id="tymethod.bar"]' 'default fn bar()' fn bar(); - // @has - '//*[@id="tymethod.baz"]' 'unsafe fn baz()' - // @!has - '//*[@id="tymethod.baz"]' 'default unsafe fn baz()' + //@ has - '//*[@id="tymethod.baz"]' 'unsafe fn baz()' + //@ !has - '//*[@id="tymethod.baz"]' 'default unsafe fn baz()' unsafe fn baz(); - // @has - '//*[@id="tymethod.quux"]' 'unsafe fn quux()' - // @!has - '//*[@id="tymethod.quux"]' 'default unsafe fn quux()' + //@ has - '//*[@id="tymethod.quux"]' 'unsafe fn quux()' + //@ !has - '//*[@id="tymethod.quux"]' 'default unsafe fn quux()' unsafe fn quux(); - // @has - '//*[@id="method.xyzzy"]' 'fn xyzzy()' - // @!has - '//*[@id="method.xyzzy"]' 'default fn xyzzy()' + //@ has - '//*[@id="method.xyzzy"]' 'fn xyzzy()' + //@ !has - '//*[@id="method.xyzzy"]' 'default fn xyzzy()' fn xyzzy() {} } -// @has default_trait_method/struct.Foo.html +//@ has default_trait_method/struct.Foo.html pub struct Foo; impl Item for Foo { - // @has - '//*[@id="method.foo"]' 'default fn foo()' + //@ has - '//*[@id="method.foo"]' 'default fn foo()' default fn foo() {} - // @has - '//*[@id="method.bar"]' 'fn bar()' - // @!has - '//*[@id="method.bar"]' 'default fn bar()' + //@ has - '//*[@id="method.bar"]' 'fn bar()' + //@ !has - '//*[@id="method.bar"]' 'default fn bar()' fn bar() {} - // @has - '//*[@id="method.baz"]' 'default unsafe fn baz()' + //@ has - '//*[@id="method.baz"]' 'default unsafe fn baz()' default unsafe fn baz() {} - // @has - '//*[@id="method.quux"]' 'unsafe fn quux()' - // @!has - '//*[@id="method.quux"]' 'default unsafe fn quux()' + //@ has - '//*[@id="method.quux"]' 'unsafe fn quux()' + //@ !has - '//*[@id="method.quux"]' 'default unsafe fn quux()' unsafe fn quux() {} - // @has - '//*[@id="method.xyzzy"]' 'fn xyzzy()' - // @!has - '//*[@id="method.xyzzy"]' 'default fn xyzzy()' + //@ has - '//*[@id="method.xyzzy"]' 'fn xyzzy()' + //@ !has - '//*[@id="method.xyzzy"]' 'default fn xyzzy()' } diff --git a/tests/rustdoc/deprecated-future-staged-api.rs b/tests/rustdoc/deprecated-future-staged-api.rs index 64dfd893050..1bb44e2a520 100644 --- a/tests/rustdoc/deprecated-future-staged-api.rs +++ b/tests/rustdoc/deprecated-future-staged-api.rs @@ -1,17 +1,17 @@ #![feature(staged_api)] #![stable(feature = "deprecated_future_staged_api", since = "1.0.0")] -// @has deprecated_future_staged_api/index.html '//*[@class="stab deprecated"]' \ +//@ has deprecated_future_staged_api/index.html '//*[@class="stab deprecated"]' \ // 'Deprecation planned' -// @has deprecated_future_staged_api/struct.S1.html '//*[@class="stab deprecated"]' \ +//@ has deprecated_future_staged_api/struct.S1.html '//*[@class="stab deprecated"]' \ // 'Deprecating in 99.99.99: effectively never' #[deprecated(since = "99.99.99", note = "effectively never")] #[stable(feature = "deprecated_future_staged_api", since = "1.0.0")] pub struct S1; -// @has deprecated_future_staged_api/index.html '//*[@class="stab deprecated"]' \ +//@ has deprecated_future_staged_api/index.html '//*[@class="stab deprecated"]' \ // 'Deprecation planned' -// @has deprecated_future_staged_api/struct.S2.html '//*[@class="stab deprecated"]' \ +//@ has deprecated_future_staged_api/struct.S2.html '//*[@class="stab deprecated"]' \ // 'Deprecating in a future version: literally never' #[deprecated(since = "TBD", note = "literally never")] #[stable(feature = "deprecated_future_staged_api", since = "1.0.0")] diff --git a/tests/rustdoc/deprecated-future.rs b/tests/rustdoc/deprecated-future.rs index 7db8cc60281..8e669e43bf7 100644 --- a/tests/rustdoc/deprecated-future.rs +++ b/tests/rustdoc/deprecated-future.rs @@ -1,6 +1,6 @@ -// @has deprecated_future/index.html '//*[@class="stab deprecated"]' \ +//@ has deprecated_future/index.html '//*[@class="stab deprecated"]' \ // 'Deprecated' -// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \ +//@ has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \ // 'Deprecated since 99.99.99: effectively never' #[deprecated(since = "99.99.99", note = "effectively never")] pub struct S; diff --git a/tests/rustdoc/deprecated-impls.rs b/tests/rustdoc/deprecated-impls.rs index e419d2631f6..a57f26ec7fd 100644 --- a/tests/rustdoc/deprecated-impls.rs +++ b/tests/rustdoc/deprecated-impls.rs @@ -1,19 +1,19 @@ #![crate_name = "foo"] -// @has foo/struct.Foo0.html +//@ has foo/struct.Foo0.html pub struct Foo0; impl Foo0 { - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc' - // @hasraw - 'fn_with_doc short' - // @hasraw - 'fn_with_doc full' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc' + //@ hasraw - 'fn_with_doc short' + //@ hasraw - 'fn_with_doc full' /// fn_with_doc short /// /// fn_with_doc full #[deprecated(since = "1.0.1", note = "fn_with_doc")] pub fn fn_with_doc() {} - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.2: fn_without_doc' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.2: fn_without_doc' #[deprecated(since = "1.0.2", note = "fn_without_doc")] pub fn fn_without_doc() {} } @@ -47,72 +47,72 @@ pub trait Bar { fn fn_def_def_without_doc() {} } -// @has foo/struct.Foo1.html +//@ has foo/struct.Foo1.html pub struct Foo1; impl Bar for Foo1 { - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc' - // @hasraw - 'fn_empty_with_doc_impl short' - // @hasraw - 'fn_empty_with_doc_impl full' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc' + //@ hasraw - 'fn_empty_with_doc_impl short' + //@ hasraw - 'fn_empty_with_doc_impl full' /// fn_empty_with_doc_impl short /// /// fn_empty_with_doc_impl full fn fn_empty_with_doc() {} - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc' fn fn_empty_without_doc() {} - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc' - // @hasraw - 'fn_def_with_doc_impl short' - // @hasraw - 'fn_def_with_doc_impl full' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc' + //@ hasraw - 'fn_def_with_doc_impl short' + //@ hasraw - 'fn_def_with_doc_impl full' /// fn_def_with_doc_impl short /// /// fn_def_with_doc_impl full fn fn_def_with_doc() {} - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc' fn fn_def_without_doc() {} - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc' - // @hasraw - 'fn_def_def_with_doc short' - // @!hasraw - 'fn_def_def_with_doc full' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc' + //@ hasraw - 'fn_def_def_with_doc short' + //@ !hasraw - 'fn_def_def_with_doc full' - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc' } -// @has foo/struct.Foo2.html +//@ has foo/struct.Foo2.html pub struct Foo2; impl Bar for Foo2 { - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc' - // @hasraw - 'fn_empty_with_doc short' - // @!hasraw - 'fn_empty_with_doc full' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc' + //@ hasraw - 'fn_empty_with_doc short' + //@ !hasraw - 'fn_empty_with_doc full' fn fn_empty_with_doc() {} - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc' - // @hasraw - 'fn_empty_without_doc_impl short' - // @hasraw - 'fn_empty_without_doc_impl full' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc' + //@ hasraw - 'fn_empty_without_doc_impl short' + //@ hasraw - 'fn_empty_without_doc_impl full' /// fn_empty_without_doc_impl short /// /// fn_empty_without_doc_impl full fn fn_empty_without_doc() {} - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc' - // @hasraw - 'fn_def_with_doc short' - // @!hasraw - 'fn_def_with_doc full' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc' + //@ hasraw - 'fn_def_with_doc short' + //@ !hasraw - 'fn_def_with_doc full' fn fn_def_with_doc() {} - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc' - // @hasraw - 'fn_def_without_doc_impl short' - // @hasraw - 'fn_def_without_doc_impl full' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc' + //@ hasraw - 'fn_def_without_doc_impl short' + //@ hasraw - 'fn_def_without_doc_impl full' /// fn_def_without_doc_impl short /// /// fn_def_without_doc_impl full fn fn_def_without_doc() {} - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc' - // @hasraw - 'fn_def_def_with_doc short' - // @!hasraw - 'fn_def_def_with_doc full' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc' + //@ hasraw - 'fn_def_def_with_doc short' + //@ !hasraw - 'fn_def_def_with_doc full' - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc' } diff --git a/tests/rustdoc/deprecated.rs b/tests/rustdoc/deprecated.rs index 9c9c0945b8f..b39da9b440a 100644 --- a/tests/rustdoc/deprecated.rs +++ b/tests/rustdoc/deprecated.rs @@ -1,33 +1,33 @@ -// @has deprecated/index.html '//*[@class="item-name"]/span[@class="stab deprecated"]' \ +//@ has deprecated/index.html '//*[@class="item-name"]/span[@class="stab deprecated"]' \ // 'Deprecated' -// @has - '//*[@class="desc docblock-short"]' 'Deprecated docs' +//@ has - '//*[@class="desc docblock-short"]' 'Deprecated docs' -// @has deprecated/struct.S.html '//*[@class="stab deprecated"]' \ +//@ has deprecated/struct.S.html '//*[@class="stab deprecated"]' \ // 'Deprecated since 1.0.0: text' /// Deprecated docs #[deprecated(since = "1.0.0", note = "text")] pub struct S; -// @matches deprecated/index.html '//*[@class="desc docblock-short"]' '^Docs' +//@ matches deprecated/index.html '//*[@class="desc docblock-short"]' '^Docs' /// Docs pub struct T; -// @matches deprecated/struct.U.html '//*[@class="stab deprecated"]' \ +//@ matches deprecated/struct.U.html '//*[@class="stab deprecated"]' \ // 'Deprecated since 1.0.0$' #[deprecated(since = "1.0.0")] pub struct U; -// @matches deprecated/struct.V.html '//*[@class="stab deprecated"]' \ +//@ matches deprecated/struct.V.html '//*[@class="stab deprecated"]' \ // 'Deprecated: text$' #[deprecated(note = "text")] pub struct V; -// @matches deprecated/struct.W.html '//*[@class="stab deprecated"]' \ +//@ matches deprecated/struct.W.html '//*[@class="stab deprecated"]' \ // 'Deprecated$' #[deprecated] pub struct W; -// @matches deprecated/struct.X.html '//*[@class="stab deprecated"]' \ +//@ matches deprecated/struct.X.html '//*[@class="stab deprecated"]' \ // 'Deprecated: shorthand reason: code$' #[deprecated = "shorthand reason: `code`"] pub struct X; diff --git a/tests/rustdoc/deref-methods-19190-foreign-type.rs b/tests/rustdoc/deref-methods-19190-foreign-type.rs index c8326992115..7ac0521eb29 100644 --- a/tests/rustdoc/deref-methods-19190-foreign-type.rs +++ b/tests/rustdoc/deref-methods-19190-foreign-type.rs @@ -11,6 +11,6 @@ impl Deref for Bar { fn deref(&self) -> &String { loop {} } } -// @has issue_19190_2/struct.Bar.html -// @!has - '//*[@id="method.new"]' 'fn new() -> String' -// @has - '//*[@id="method.as_str"]' 'fn as_str(&self) -> &str' +//@ has issue_19190_2/struct.Bar.html +//@ !has - '//*[@id="method.new"]' 'fn new() -> String' +//@ has - '//*[@id="method.as_str"]' 'fn as_str(&self) -> &str' diff --git a/tests/rustdoc/deref-methods-19190-inline.rs b/tests/rustdoc/deref-methods-19190-inline.rs index ef31cc70d93..942edbd5aaf 100644 --- a/tests/rustdoc/deref-methods-19190-inline.rs +++ b/tests/rustdoc/deref-methods-19190-inline.rs @@ -9,19 +9,19 @@ extern crate issue_19190_3; use std::ops::Deref; use issue_19190_3::Baz; -// @has issue_19190_3/struct.Foo.html -// @has - '//*[@id="method.as_str"]' 'fn as_str(&self) -> &str' -// @!has - '//*[@id="method.new"]' 'fn new() -> String' +//@ has issue_19190_3/struct.Foo.html +//@ has - '//*[@id="method.as_str"]' 'fn as_str(&self) -> &str' +//@ !has - '//*[@id="method.new"]' 'fn new() -> String' pub use issue_19190_3::Foo; -// @has issue_19190_3/struct.Bar.html -// @has - '//*[@id="method.baz"]' 'fn baz(&self)' -// @!has - '//*[@id="method.static_baz"]' 'fn static_baz()' +//@ has issue_19190_3/struct.Bar.html +//@ has - '//*[@id="method.baz"]' 'fn baz(&self)' +//@ !has - '//*[@id="method.static_baz"]' 'fn static_baz()' pub use issue_19190_3::Bar; -// @has issue_19190_3/struct.MyBar.html -// @has - '//*[@id="method.baz"]' 'fn baz(&self)' -// @!has - '//*[@id="method.static_baz"]' 'fn static_baz()' +//@ has issue_19190_3/struct.MyBar.html +//@ has - '//*[@id="method.baz"]' 'fn baz(&self)' +//@ !has - '//*[@id="method.static_baz"]' 'fn static_baz()' pub struct MyBar; impl Deref for MyBar { diff --git a/tests/rustdoc/deref-methods-19190.rs b/tests/rustdoc/deref-methods-19190.rs index 4c274d82ff7..ea10ac3b678 100644 --- a/tests/rustdoc/deref-methods-19190.rs +++ b/tests/rustdoc/deref-methods-19190.rs @@ -16,8 +16,8 @@ impl Deref for Bar { fn deref(&self) -> &Foo { loop {} } } -// @has issue_19190/struct.Bar.html -// @has - '//*[@id="method.foo"]//h4[@class="code-header"]' 'fn foo(&self)' -// @has - '//*[@id="method.foo"]' 'fn foo(&self)' -// @!has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()' -// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()' +//@ has issue_19190/struct.Bar.html +//@ has - '//*[@id="method.foo"]//h4[@class="code-header"]' 'fn foo(&self)' +//@ has - '//*[@id="method.foo"]' 'fn foo(&self)' +//@ !has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()' +//@ !has - '//*[@id="method.static_foo"]' 'fn static_foo()' diff --git a/tests/rustdoc/deref-mut-35169-2.rs b/tests/rustdoc/deref-mut-35169-2.rs index c82323ddc6a..37462790f2e 100644 --- a/tests/rustdoc/deref-mut-35169-2.rs +++ b/tests/rustdoc/deref-mut-35169-2.rs @@ -26,18 +26,18 @@ impl DerefMut for Bar { fn deref_mut(&mut self) -> &mut Foo { loop {} } } -// @has foo/struct.Bar.html -// @has - '//*[@id="method.by_ref"]//h4[@class="code-header"]' 'fn by_ref(&self)' -// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)' -// @has - '//*[@id="method.by_explicit_ref"]//h4[@class="code-header"]' 'fn by_explicit_ref(self: &Foo)' -// @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)' -// @has - '//*[@id="method.by_mut_ref"]//h4[@class="code-header"]' 'fn by_mut_ref(&mut self)' -// @has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)' -// @has - '//*[@id="method.by_explicit_mut_ref"]//h4[@class="code-header"]' 'fn by_explicit_mut_ref(self: &mut Foo)' -// @has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)' -// @!has - '//*[@id="method.by_explicit_box"]//h4[@class="code-header"]' 'fn by_explicit_box(self: Box)' -// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box)' -// @!has - '//*[@id="method.by_explicit_self_box"]//h4[@class="code-header"]' 'fn by_explicit_self_box(self: Box)' -// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box)' -// @!has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()' -// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()' +//@ has foo/struct.Bar.html +//@ has - '//*[@id="method.by_ref"]//h4[@class="code-header"]' 'fn by_ref(&self)' +//@ has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)' +//@ has - '//*[@id="method.by_explicit_ref"]//h4[@class="code-header"]' 'fn by_explicit_ref(self: &Foo)' +//@ has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)' +//@ has - '//*[@id="method.by_mut_ref"]//h4[@class="code-header"]' 'fn by_mut_ref(&mut self)' +//@ has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)' +//@ has - '//*[@id="method.by_explicit_mut_ref"]//h4[@class="code-header"]' 'fn by_explicit_mut_ref(self: &mut Foo)' +//@ has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)' +//@ !has - '//*[@id="method.by_explicit_box"]//h4[@class="code-header"]' 'fn by_explicit_box(self: Box)' +//@ !has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box)' +//@ !has - '//*[@id="method.by_explicit_self_box"]//h4[@class="code-header"]' 'fn by_explicit_self_box(self: Box)' +//@ !has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box)' +//@ !has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()' +//@ !has - '//*[@id="method.static_foo"]' 'fn static_foo()' diff --git a/tests/rustdoc/deref-mut-35169.rs b/tests/rustdoc/deref-mut-35169.rs index 44afaf2e903..07a3754f795 100644 --- a/tests/rustdoc/deref-mut-35169.rs +++ b/tests/rustdoc/deref-mut-35169.rs @@ -21,18 +21,18 @@ impl Deref for Bar { fn deref(&self) -> &Foo { loop {} } } -// @has foo/struct.Bar.html -// @has - '//*[@id="method.by_ref"]//h4[@class="code-header"]' 'fn by_ref(&self)' -// @has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)' -// @has - '//*[@id="method.by_explicit_ref"]//h4[@class="code-header"]' 'fn by_explicit_ref(self: &Foo)' -// @has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)' -// @!has - '//*[@id="method.by_mut_ref"]//h4[@class="code-header"]' 'fn by_mut_ref(&mut self)' -// @!has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)' -// @!has - '//*[@id="method.by_explicit_mut_ref"]//h4[@class="code-header"]' 'fn by_explicit_mut_ref(self: &mut Foo)' -// @!has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)' -// @!has - '//*[@id="method.by_explicit_box"]//h4[@class="code-header"]' 'fn by_explicit_box(self: Box)' -// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box)' -// @!has - '//*[@id="method.by_explicit_self_box"]//h4[@class="code-header"]' 'fn by_explicit_self_box(self: Box)' -// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box)' -// @!has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()' -// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()' +//@ has foo/struct.Bar.html +//@ has - '//*[@id="method.by_ref"]//h4[@class="code-header"]' 'fn by_ref(&self)' +//@ has - '//*[@id="method.by_ref"]' 'fn by_ref(&self)' +//@ has - '//*[@id="method.by_explicit_ref"]//h4[@class="code-header"]' 'fn by_explicit_ref(self: &Foo)' +//@ has - '//*[@id="method.by_explicit_ref"]' 'fn by_explicit_ref(self: &Foo)' +//@ !has - '//*[@id="method.by_mut_ref"]//h4[@class="code-header"]' 'fn by_mut_ref(&mut self)' +//@ !has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)' +//@ !has - '//*[@id="method.by_explicit_mut_ref"]//h4[@class="code-header"]' 'fn by_explicit_mut_ref(self: &mut Foo)' +//@ !has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)' +//@ !has - '//*[@id="method.by_explicit_box"]//h4[@class="code-header"]' 'fn by_explicit_box(self: Box)' +//@ !has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box)' +//@ !has - '//*[@id="method.by_explicit_self_box"]//h4[@class="code-header"]' 'fn by_explicit_self_box(self: Box)' +//@ !has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box)' +//@ !has - '//*[@id="method.static_foo"]//h4[@class="code-header"]' 'fn static_foo()' +//@ !has - '//*[@id="method.static_foo"]' 'fn static_foo()' diff --git a/tests/rustdoc/deref/deref-const-fn.rs b/tests/rustdoc/deref/deref-const-fn.rs index 85c2f2934e0..fa1e4730071 100644 --- a/tests/rustdoc/deref/deref-const-fn.rs +++ b/tests/rustdoc/deref/deref-const-fn.rs @@ -7,13 +7,13 @@ #![stable(feature = "rust1", since = "1.0.0")] -// @has 'foo/struct.Bar.html' +//@ has 'foo/struct.Bar.html' #[stable(feature = "rust1", since = "1.0.0")] pub struct Bar; impl Bar { - // @has - '//*[@id="method.len"]' 'pub const fn len(&self) -> usize' - // @has - '//*[@id="method.len"]//span[@class="since"]' 'const: 1.0.0' + //@ has - '//*[@id="method.len"]' 'pub const fn len(&self) -> usize' + //@ has - '//*[@id="method.len"]//span[@class="since"]' 'const: 1.0.0' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] pub const fn len(&self) -> usize { 0 } @@ -24,10 +24,10 @@ pub struct Foo { value: Bar, } -// @has 'foo/struct.Foo.html' -// @has - '//*[@id="method.len"]' 'pub fn len(&self) -> usize' -// @has - '//*[@id="method.len"]//span[@class="since"]' '1.0.0' -// @!has - '//*[@id="method.len"]//span[@class="since"]' '(const: 1.0.0)' +//@ has 'foo/struct.Foo.html' +//@ has - '//*[@id="method.len"]' 'pub fn len(&self) -> usize' +//@ has - '//*[@id="method.len"]//span[@class="since"]' '1.0.0' +//@ !has - '//*[@id="method.len"]//span[@class="since"]' '(const: 1.0.0)' #[stable(feature = "rust1", since = "1.0.0")] impl std::ops::Deref for Foo { type Target = Bar; diff --git a/tests/rustdoc/deref/deref-multiple-impl-blocks.rs b/tests/rustdoc/deref/deref-multiple-impl-blocks.rs index fa3607c5fc1..2ce35627546 100644 --- a/tests/rustdoc/deref/deref-multiple-impl-blocks.rs +++ b/tests/rustdoc/deref/deref-multiple-impl-blocks.rs @@ -2,11 +2,11 @@ use std::ops::{Deref, DerefMut}; -// @has foo/struct.Vec.html -// @count - '//h2[@id="deref-methods-Slice"]' 1 -// @count - '//div[@id="deref-methods-Slice-1"]' 1 -// @count - '//div[@id="deref-methods-Slice-1"][@class="impl-items"]' 1 -// @count - '//div[@id="deref-methods-Slice-1"]/div[@class="impl-items"]' 0 +//@ has foo/struct.Vec.html +//@ count - '//h2[@id="deref-methods-Slice"]' 1 +//@ count - '//div[@id="deref-methods-Slice-1"]' 1 +//@ count - '//div[@id="deref-methods-Slice-1"][@class="impl-items"]' 1 +//@ count - '//div[@id="deref-methods-Slice-1"]/div[@class="impl-items"]' 0 pub struct Vec; pub struct Slice; diff --git a/tests/rustdoc/deref/deref-mut-methods.rs b/tests/rustdoc/deref/deref-mut-methods.rs index 65681f81245..83214ca3b8a 100644 --- a/tests/rustdoc/deref/deref-mut-methods.rs +++ b/tests/rustdoc/deref/deref-mut-methods.rs @@ -8,8 +8,8 @@ impl Foo { pub fn foo(&mut self) {} } -// @has foo/struct.Bar.html -// @has - '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.foo"]' 'foo' +//@ has foo/struct.Bar.html +//@ has - '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.foo"]' 'foo' pub struct Bar { foo: Foo, } diff --git a/tests/rustdoc/deref/deref-recursive-pathbuf.rs b/tests/rustdoc/deref/deref-recursive-pathbuf.rs index 7aee3147ba8..be6b1811503 100644 --- a/tests/rustdoc/deref/deref-recursive-pathbuf.rs +++ b/tests/rustdoc/deref/deref-recursive-pathbuf.rs @@ -2,15 +2,15 @@ // levels and across multiple crates. // For `Deref` on non-foreign types, look at `deref-recursive.rs`. -// @has 'foo/struct.Foo.html' -// @has '-' '//*[@id="deref-methods-PathBuf"]' 'Methods from Deref' -// @has '-' '//*[@class="impl-items"]//*[@id="method.as_path"]' 'pub fn as_path(&self)' -// @has '-' '//*[@id="deref-methods-Path"]' 'Methods from Deref' -// @has '-' '//*[@class="impl-items"]//*[@id="method.exists"]' 'pub fn exists(&self)' -// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-PathBuf"]' 'Methods from Deref' -// @has '-' '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.as_path"]' 'as_path' -// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Path"]' 'Methods from Deref' -// @has '-' '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.exists"]' 'exists' +//@ has 'foo/struct.Foo.html' +//@ has '-' '//*[@id="deref-methods-PathBuf"]' 'Methods from Deref' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.as_path"]' 'pub fn as_path(&self)' +//@ has '-' '//*[@id="deref-methods-Path"]' 'Methods from Deref' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.exists"]' 'pub fn exists(&self)' +//@ has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-PathBuf"]' 'Methods from Deref' +//@ has '-' '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.as_path"]' 'as_path' +//@ has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Path"]' 'Methods from Deref' +//@ has '-' '//*[@class="sidebar-elems"]//*[@class="block deref-methods"]//a[@href="#method.exists"]' 'exists' #![crate_name = "foo"] diff --git a/tests/rustdoc/deref/deref-recursive.rs b/tests/rustdoc/deref/deref-recursive.rs index 0436f2f86f5..604ce7a40c0 100644 --- a/tests/rustdoc/deref/deref-recursive.rs +++ b/tests/rustdoc/deref/deref-recursive.rs @@ -2,15 +2,15 @@ // levels if needed. // For `Deref` on foreign types, look at `deref-recursive-pathbuf.rs`. -// @has 'foo/struct.Foo.html' -// @has '-' '//*[@id="deref-methods-Bar"]' 'Methods from Deref' -// @has '-' '//*[@class="impl-items"]//*[@id="method.bar"]' 'pub fn bar(&self)' -// @has '-' '//*[@id="deref-methods-Baz"]' 'Methods from Deref' -// @has '-' '//*[@class="impl-items"]//*[@id="method.baz"]' 'pub fn baz(&self)' -// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Bar"]' 'Methods from Deref' -// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.bar"]' 'bar' -// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Baz"]' 'Methods from Deref' -// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.baz"]' 'baz' +//@ has 'foo/struct.Foo.html' +//@ has '-' '//*[@id="deref-methods-Bar"]' 'Methods from Deref' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.bar"]' 'pub fn bar(&self)' +//@ has '-' '//*[@id="deref-methods-Baz"]' 'Methods from Deref' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.baz"]' 'pub fn baz(&self)' +//@ has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Bar"]' 'Methods from Deref' +//@ has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.bar"]' 'bar' +//@ has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Baz"]' 'Methods from Deref' +//@ has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.baz"]' 'baz' #![crate_name = "foo"] diff --git a/tests/rustdoc/deref/deref-slice-core.rs b/tests/rustdoc/deref/deref-slice-core.rs index cccf273a820..3a21c19ddd1 100644 --- a/tests/rustdoc/deref/deref-slice-core.rs +++ b/tests/rustdoc/deref/deref-slice-core.rs @@ -5,9 +5,9 @@ use core::ops::Deref; -// @has 'deref_slice_core/struct.MyArray.html' -// @has '-' '//*[@id="deref-methods-%5BT%5D"]' 'Methods from Deref' -// @has '-' '//*[@class="impl-items"]//*[@id="method.len"]' 'pub fn len(&self)' +//@ has 'deref_slice_core/struct.MyArray.html' +//@ has '-' '//*[@id="deref-methods-%5BT%5D"]' 'Methods from Deref' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.len"]' 'pub fn len(&self)' pub struct MyArray { array: [T; 10], diff --git a/tests/rustdoc/deref/deref-to-primitive.rs b/tests/rustdoc/deref/deref-to-primitive.rs index 527de780d48..7a5a3cd8fd6 100644 --- a/tests/rustdoc/deref/deref-to-primitive.rs +++ b/tests/rustdoc/deref/deref-to-primitive.rs @@ -1,8 +1,8 @@ #![crate_name = "foo"] -// @has 'foo/struct.Foo.html' -// @has - '//*[@id="deref-methods-i32"]' 'Methods from Deref' -// @has - '//*[@id="deref-methods-i32-1"]//*[@id="associatedconstant.BITS"]/h4' \ +//@ has 'foo/struct.Foo.html' +//@ has - '//*[@id="deref-methods-i32"]' 'Methods from Deref' +//@ has - '//*[@id="deref-methods-i32-1"]//*[@id="associatedconstant.BITS"]/h4' \ // 'pub const BITS: u32 = 32u32' pub struct Foo(i32); diff --git a/tests/rustdoc/deref/deref-typedef.rs b/tests/rustdoc/deref/deref-typedef.rs index 32424d13eb8..44324cc6f41 100644 --- a/tests/rustdoc/deref/deref-typedef.rs +++ b/tests/rustdoc/deref/deref-typedef.rs @@ -1,16 +1,16 @@ #![crate_name = "foo"] -// @has 'foo/struct.Bar.html' -// @has '-' '//*[@id="deref-methods-FooJ"]' 'Methods from Deref' -// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_a"]' 'pub fn foo_a(&self)' -// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_b"]' 'pub fn foo_b(&self)' -// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_c"]' 'pub fn foo_c(&self)' -// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_j"]' 'pub fn foo_j(&self)' -// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-FooJ"]' 'Methods from Deref' -// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_a"]' 'foo_a' -// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_b"]' 'foo_b' -// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_c"]' 'foo_c' -// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_j"]' 'foo_j' +//@ has 'foo/struct.Bar.html' +//@ has '-' '//*[@id="deref-methods-FooJ"]' 'Methods from Deref' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.foo_a"]' 'pub fn foo_a(&self)' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.foo_b"]' 'pub fn foo_b(&self)' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.foo_c"]' 'pub fn foo_c(&self)' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.foo_j"]' 'pub fn foo_j(&self)' +//@ has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-FooJ"]' 'Methods from Deref' +//@ has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_a"]' 'foo_a' +//@ has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_b"]' 'foo_b' +//@ has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_c"]' 'foo_c' +//@ has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_j"]' 'foo_j' pub struct FooA; pub type FooB = FooA; diff --git a/tests/rustdoc/deref/escape-deref-methods.rs b/tests/rustdoc/deref/escape-deref-methods.rs index 66919d73eeb..2e423640f67 100644 --- a/tests/rustdoc/deref/escape-deref-methods.rs +++ b/tests/rustdoc/deref/escape-deref-methods.rs @@ -26,8 +26,8 @@ impl Deref for TitleList { } } -// @has foo/struct.TitleList.html -// @has - '//div[@class="sidebar-elems"]//h3' 'Methods from Deref>' +//@ has foo/struct.TitleList.html +//@ has - '//div[@class="sidebar-elems"]//h3' 'Methods from Deref>' impl DerefMut for TitleList { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.members diff --git a/tests/rustdoc/deref/issue-100679-sidebar-links-deref.rs b/tests/rustdoc/deref/issue-100679-sidebar-links-deref.rs index f09d2320609..44ac08de0b8 100644 --- a/tests/rustdoc/deref/issue-100679-sidebar-links-deref.rs +++ b/tests/rustdoc/deref/issue-100679-sidebar-links-deref.rs @@ -11,7 +11,7 @@ impl std::ops::Deref for Vec { } } -// @has foo/struct.Vec.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty"]' \ +//@ has foo/struct.Vec.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty"]' \ // "is_empty" impl Vec { pub fn is_empty(&self) -> bool { @@ -19,9 +19,9 @@ impl Vec { } } -// @has foo/struct.Vec.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty-1"]' \ +//@ has foo/struct.Vec.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty-1"]' \ // "is_empty" -// @has foo/struct.Slice.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty"]' \ +//@ has foo/struct.Slice.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty"]' \ // "is_empty" impl Slice { pub fn is_empty(&self) -> bool { diff --git a/tests/rustdoc/deref/recursive-deref-sidebar.rs b/tests/rustdoc/deref/recursive-deref-sidebar.rs index 619f40eff89..0af5326f3dc 100644 --- a/tests/rustdoc/deref/recursive-deref-sidebar.rs +++ b/tests/rustdoc/deref/recursive-deref-sidebar.rs @@ -9,13 +9,13 @@ impl B { pub fn foo_b(&self) {} } pub struct C {} impl C { pub fn foo_c(&self) {} } -// @has recursive_deref_sidebar/struct.A.html '//*[@class="sidebar-elems"]//section' 'foo_b' +//@ has recursive_deref_sidebar/struct.A.html '//*[@class="sidebar-elems"]//section' 'foo_b' impl Deref for A { type Target = B; fn deref(&self) -> &B { todo!() } } -// @has recursive_deref_sidebar/struct.A.html '//*[@class="sidebar-elems"]//section' 'foo_c' +//@ has recursive_deref_sidebar/struct.A.html '//*[@class="sidebar-elems"]//section' 'foo_c' impl Deref for B { type Target = C; fn deref(&self) -> &C { todo!() } diff --git a/tests/rustdoc/deref/recursive-deref.rs b/tests/rustdoc/deref/recursive-deref.rs index aa38485c445..286abef382c 100644 --- a/tests/rustdoc/deref/recursive-deref.rs +++ b/tests/rustdoc/deref/recursive-deref.rs @@ -9,8 +9,8 @@ impl C { pub fn c(&self) {} } -// @has recursive_deref/struct.A.html '//h3[@class="code-header"]' 'impl Deref for A' -// @has '-' '//*[@class="impl-items"]//*[@id="method.c"]' 'pub fn c(&self)' +//@ has recursive_deref/struct.A.html '//h3[@class="code-header"]' 'impl Deref for A' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.c"]' 'pub fn c(&self)' impl Deref for A { type Target = B; @@ -19,8 +19,8 @@ impl Deref for A { } } -// @has recursive_deref/struct.B.html '//h3[@class="code-header"]' 'impl Deref for B' -// @has '-' '//*[@class="impl-items"]//*[@id="method.c"]' 'pub fn c(&self)' +//@ has recursive_deref/struct.B.html '//h3[@class="code-header"]' 'impl Deref for B' +//@ has '-' '//*[@class="impl-items"]//*[@id="method.c"]' 'pub fn c(&self)' impl Deref for B { type Target = C; @@ -29,7 +29,7 @@ impl Deref for B { } } -// @has recursive_deref/struct.C.html '//h3[@class="code-header"]' 'impl Deref for C' +//@ has recursive_deref/struct.C.html '//h3[@class="code-header"]' 'impl Deref for C' impl Deref for C { type Target = B; @@ -49,9 +49,9 @@ impl G { pub fn g() {} } -// @has recursive_deref/struct.D.html '//h3[@class="code-header"]' 'impl Deref for D' +//@ has recursive_deref/struct.D.html '//h3[@class="code-header"]' 'impl Deref for D' // We also check that `G::g` method isn't rendered because there is no `self` argument. -// @!has '-' '//*[@id="deref-methods-G"]' '' +//@ !has '-' '//*[@id="deref-methods-G"]' '' impl Deref for D { type Target = E; @@ -60,9 +60,9 @@ impl Deref for D { } } -// @has recursive_deref/struct.E.html '//h3[@class="code-header"]' 'impl Deref for E' +//@ has recursive_deref/struct.E.html '//h3[@class="code-header"]' 'impl Deref for E' // We also check that `G::g` method isn't rendered because there is no `self` argument. -// @!has '-' '//*[@id="deref-methods-G"]' '' +//@ !has '-' '//*[@id="deref-methods-G"]' '' impl Deref for E { type Target = F; @@ -71,9 +71,9 @@ impl Deref for E { } } -// @has recursive_deref/struct.F.html '//h3[@class="code-header"]' 'impl Deref for F' +//@ has recursive_deref/struct.F.html '//h3[@class="code-header"]' 'impl Deref for F' // We also check that `G::g` method isn't rendered because there is no `self` argument. -// @!has '-' '//*[@id="deref-methods-G"]' '' +//@ !has '-' '//*[@id="deref-methods-G"]' '' impl Deref for F { type Target = G; @@ -82,7 +82,7 @@ impl Deref for F { } } -// @has recursive_deref/struct.G.html '//h3[@class="code-header"]' 'impl Deref for G' +//@ has recursive_deref/struct.G.html '//h3[@class="code-header"]' 'impl Deref for G' impl Deref for G { type Target = E; @@ -100,8 +100,8 @@ impl I { pub fn i() {} } -// @has recursive_deref/struct.H.html '//h3[@class="code-header"]' 'impl Deref for H' -// @!has '-' '//*[@id="deref-methods-I"]' '' +//@ has recursive_deref/struct.H.html '//h3[@class="code-header"]' 'impl Deref for H' +//@ !has '-' '//*[@id="deref-methods-I"]' '' impl Deref for H { type Target = I; @@ -110,7 +110,7 @@ impl Deref for H { } } -// @has recursive_deref/struct.I.html '//h3[@class="code-header"]' 'impl Deref for I' +//@ has recursive_deref/struct.I.html '//h3[@class="code-header"]' 'impl Deref for I' impl Deref for I { type Target = H; diff --git a/tests/rustdoc/description.rs b/tests/rustdoc/description.rs index aabbb4c4c8f..be6ef1dc756 100644 --- a/tests/rustdoc/description.rs +++ b/tests/rustdoc/description.rs @@ -5,13 +5,13 @@ //! This is the contents of the test crate docstring. //! It should not show up in the description. -// @has 'foo/index.html' '//meta[@name="description"]/@content' \ +//@ has 'foo/index.html' '//meta[@name="description"]/@content' \ // 'Description test crate' -// @!has - '//meta[@name="description"]/@content' 'should not show up' +//@ !has - '//meta[@name="description"]/@content' 'should not show up' -// @has 'foo/foo_mod/index.html' '//meta[@name="description"]/@content' \ +//@ has 'foo/foo_mod/index.html' '//meta[@name="description"]/@content' \ // 'First paragraph description.' -// @!has - '//meta[@name="description"]/@content' 'Second paragraph' +//@ !has - '//meta[@name="description"]/@content' 'Second paragraph' /// First paragraph description. /// /// Second paragraph should not show up. @@ -19,12 +19,12 @@ pub mod foo_mod { pub struct __Thing {} } -// @has 'foo/fn.foo_fn.html' '//meta[@name="description"]/@content' \ +//@ has 'foo/fn.foo_fn.html' '//meta[@name="description"]/@content' \ // 'Only paragraph.' /// Only paragraph. pub fn foo_fn() {} -// @has 'foo/fn.bar_fn.html' '//meta[@name="description"]/@content' \ +//@ has 'foo/fn.bar_fn.html' '//meta[@name="description"]/@content' \ // 'Description with intra-doc link to foo_fn and [nonexistent_item] and foo_fn.' #[allow(rustdoc::broken_intra_doc_links)] /// Description with intra-doc link to [foo_fn] and [nonexistent_item] and [foo_fn](self::foo_fn). diff --git a/tests/rustdoc/description_default.rs b/tests/rustdoc/description_default.rs index 21d8e04d3f9..6a673870bec 100644 --- a/tests/rustdoc/description_default.rs +++ b/tests/rustdoc/description_default.rs @@ -1,14 +1,14 @@ #![crate_name = "foo"] -// @has 'foo/index.html' '//meta[@name="description"]/@content' \ +//@ has 'foo/index.html' '//meta[@name="description"]/@content' \ // 'API documentation for the Rust `foo` crate.' -// @has 'foo/foo_mod/index.html' '//meta[@name="description"]/@content' \ +//@ has 'foo/foo_mod/index.html' '//meta[@name="description"]/@content' \ // 'API documentation for the Rust `foo_mod` mod in crate `foo`.' pub mod foo_mod { pub struct __Thing {} } -// @has 'foo/fn.foo_fn.html' '//meta[@name="description"]/@content' \ +//@ has 'foo/fn.foo_fn.html' '//meta[@name="description"]/@content' \ // 'API documentation for the Rust `foo_fn` fn in crate `foo`.' pub fn foo_fn() {} diff --git a/tests/rustdoc/disambiguate-anchors-32890.rs b/tests/rustdoc/disambiguate-anchors-32890.rs index d88601d65d3..0b726d5fba4 100644 --- a/tests/rustdoc/disambiguate-anchors-32890.rs +++ b/tests/rustdoc/disambiguate-anchors-32890.rs @@ -1,20 +1,20 @@ // https://github.com/rust-lang/rust/issues/32890 #![crate_name="issue_32890"] -// @has issue_32890/struct.Foo.html +//@ has issue_32890/struct.Foo.html pub struct Foo(T); impl Foo { - // @has - '//a[@href="#method.pass"]' 'pass' + //@ has - '//a[@href="#method.pass"]' 'pass' pub fn pass() {} } impl Foo { - // @has - '//a[@href="#method.pass-1"]' 'pass' + //@ has - '//a[@href="#method.pass-1"]' 'pass' pub fn pass() {} } impl Foo { - // @has - '//a[@href="#method.pass-2"]' 'pass' + //@ has - '//a[@href="#method.pass-2"]' 'pass' pub fn pass() {} } diff --git a/tests/rustdoc/disambiguate-anchors-header-29449.rs b/tests/rustdoc/disambiguate-anchors-header-29449.rs index 1388af7df4b..feb0632775e 100644 --- a/tests/rustdoc/disambiguate-anchors-header-29449.rs +++ b/tests/rustdoc/disambiguate-anchors-header-29449.rs @@ -1,27 +1,27 @@ // https://github.com/rust-lang/rust/issues/29449 #![crate_name="issue_29449"] -// @has issue_29449/struct.Foo.html +//@ has issue_29449/struct.Foo.html pub struct Foo; impl Foo { - // @has - '//*[@id="examples"]' 'Examples' - // @has - '//*[@id="examples"]/a[@href="#examples"]' '§' - // @has - '//*[@id="panics"]' 'Panics' - // @has - '//*[@id="panics"]/a[@href="#panics"]' '§' + //@ has - '//*[@id="examples"]' 'Examples' + //@ has - '//*[@id="examples"]/a[@href="#examples"]' '§' + //@ has - '//*[@id="panics"]' 'Panics' + //@ has - '//*[@id="panics"]/a[@href="#panics"]' '§' /// # Examples /// # Panics pub fn bar() {} - // @has - '//*[@id="examples-1"]' 'Examples' - // @has - '//*[@id="examples-1"]/a[@href="#examples-1"]' '§' + //@ has - '//*[@id="examples-1"]' 'Examples' + //@ has - '//*[@id="examples-1"]/a[@href="#examples-1"]' '§' /// # Examples pub fn bar_1() {} - // @has - '//*[@id="examples-2"]' 'Examples' - // @has - '//*[@id="examples-2"]/a[@href="#examples-2"]' '§' - // @has - '//*[@id="panics-1"]' 'Panics' - // @has - '//*[@id="panics-1"]/a[@href="#panics-1"]' '§' + //@ has - '//*[@id="examples-2"]' 'Examples' + //@ has - '//*[@id="examples-2"]/a[@href="#examples-2"]' '§' + //@ has - '//*[@id="panics-1"]' 'Panics' + //@ has - '//*[@id="panics-1"]/a[@href="#panics-1"]' '§' /// # Examples /// # Panics pub fn bar_2() {} diff --git a/tests/rustdoc/display-hidden-items.rs b/tests/rustdoc/display-hidden-items.rs index 901ca17d4d2..d9f53435e46 100644 --- a/tests/rustdoc/display-hidden-items.rs +++ b/tests/rustdoc/display-hidden-items.rs @@ -4,72 +4,72 @@ #![crate_name = "foo"] -// @has 'foo/index.html' -// @has - '//*[@class="item-name"]/span[@title="Hidden item"]' '👻' +//@ has 'foo/index.html' +//@ has - '//*[@class="item-name"]/span[@title="Hidden item"]' '👻' -// @has - '//*[@id="reexport.hidden_reexport"]/code' '#[doc(hidden)] pub use hidden::inside_hidden as hidden_reexport;' +//@ has - '//*[@id="reexport.hidden_reexport"]/code' '#[doc(hidden)] pub use hidden::inside_hidden as hidden_reexport;' #[doc(hidden)] pub use hidden::inside_hidden as hidden_reexport; -// @has - '//*[@class="item-name"]/a[@class="trait"]' 'TraitHidden' -// @has 'foo/trait.TraitHidden.html' -// @has - '//code' '#[doc(hidden)] pub trait TraitHidden' +//@ has - '//*[@class="item-name"]/a[@class="trait"]' 'TraitHidden' +//@ has 'foo/trait.TraitHidden.html' +//@ has - '//code' '#[doc(hidden)] pub trait TraitHidden' #[doc(hidden)] pub trait TraitHidden {} -// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="trait"]' 'Trait' +//@ has 'foo/index.html' '//*[@class="item-name"]/a[@class="trait"]' 'Trait' pub trait Trait { - // @has 'foo/trait.Trait.html' - // @has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' '#[doc(hidden)] const BAR: u32 = 0u32' + //@ has 'foo/trait.Trait.html' + //@ has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' '#[doc(hidden)] const BAR: u32 = 0u32' #[doc(hidden)] const BAR: u32 = 0; - // @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'fn foo()' + //@ has - '//*[@id="method.foo"]/*[@class="code-header"]' 'fn foo()' #[doc(hidden)] fn foo() {} } -// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="struct"]' 'Struct' -// @has 'foo/struct.Struct.html' +//@ has 'foo/index.html' '//*[@class="item-name"]/a[@class="struct"]' 'Struct' +//@ has 'foo/struct.Struct.html' pub struct Struct { - // @has - '//*[@id="structfield.a"]/code' 'a: u32' + //@ has - '//*[@id="structfield.a"]/code' 'a: u32' #[doc(hidden)] pub a: u32, } impl Struct { - // @has - '//*[@id="method.new"]/*[@class="code-header"]' 'pub fn new() -> Self' + //@ has - '//*[@id="method.new"]/*[@class="code-header"]' 'pub fn new() -> Self' #[doc(hidden)] pub fn new() -> Self { Self { a: 0 } } } impl Trait for Struct { - // @has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' '#[doc(hidden)] const BAR: u32 = 0u32' - // @has - '//*[@id="method.foo"]/*[@class="code-header"]' '#[doc(hidden)] fn foo()' + //@ has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' '#[doc(hidden)] const BAR: u32 = 0u32' + //@ has - '//*[@id="method.foo"]/*[@class="code-header"]' '#[doc(hidden)] fn foo()' } -// @has - '//*[@id="impl-TraitHidden-for-Struct"]/*[@class="code-header"]' 'impl TraitHidden for Struct' +//@ has - '//*[@id="impl-TraitHidden-for-Struct"]/*[@class="code-header"]' 'impl TraitHidden for Struct' impl TraitHidden for Struct {} -// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="enum"]' 'HiddenEnum' -// @has 'foo/enum.HiddenEnum.html' -// @has - '//code' '#[doc(hidden)] pub enum HiddenEnum' +//@ has 'foo/index.html' '//*[@class="item-name"]/a[@class="enum"]' 'HiddenEnum' +//@ has 'foo/enum.HiddenEnum.html' +//@ has - '//code' '#[doc(hidden)] pub enum HiddenEnum' #[doc(hidden)] pub enum HiddenEnum { A, } -// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="enum"]' 'Enum' +//@ has 'foo/index.html' '//*[@class="item-name"]/a[@class="enum"]' 'Enum' pub enum Enum { - // @has 'foo/enum.Enum.html' '//*[@id="variant.A"]/*[@class="code-header"]' 'A' + //@ has 'foo/enum.Enum.html' '//*[@id="variant.A"]/*[@class="code-header"]' 'A' #[doc(hidden)] A, } -// @has 'foo/index.html' '//*[@class="item-name"]/a[@class="mod"]' 'hidden' +//@ has 'foo/index.html' '//*[@class="item-name"]/a[@class="mod"]' 'hidden' #[doc(hidden)] pub mod hidden { - // @has 'foo/hidden/index.html' - // @has - '//*[@class="item-name"]/a[@class="fn"]' 'inside_hidden' - // @has 'foo/hidden/fn.inside_hidden.html' + //@ has 'foo/hidden/index.html' + //@ has - '//*[@class="item-name"]/a[@class="fn"]' 'inside_hidden' + //@ has 'foo/hidden/fn.inside_hidden.html' pub fn inside_hidden() {} } diff --git a/tests/rustdoc/doc-assoc-item.rs b/tests/rustdoc/doc-assoc-item.rs index 4d5c9f83e1e..2eb82abfc0b 100644 --- a/tests/rustdoc/doc-assoc-item.rs +++ b/tests/rustdoc/doc-assoc-item.rs @@ -8,7 +8,7 @@ pub trait Bar { fn foo(foo: Self::Fuu); } -// @has doc_assoc_item/struct.Foo.html '//*[@class="impl"]' 'impl> Foo' +//@ has doc_assoc_item/struct.Foo.html '//*[@class="impl"]' 'impl> Foo' impl> Foo { pub fn new(t: T) -> Foo { Foo { diff --git a/tests/rustdoc/doc-attr-comment-mix-42760.rs b/tests/rustdoc/doc-attr-comment-mix-42760.rs index 16c1705eb00..c457ac74d8d 100644 --- a/tests/rustdoc/doc-attr-comment-mix-42760.rs +++ b/tests/rustdoc/doc-attr-comment-mix-42760.rs @@ -3,8 +3,8 @@ #![allow(rustdoc::invalid_rust_codeblocks)] -// @has foo/struct.NonGen.html -// @has - '//h2' 'Example' +//@ has foo/struct.NonGen.html +//@ has - '//h2' 'Example' /// Item docs. /// diff --git a/tests/rustdoc/doc-auto-cfg.rs b/tests/rustdoc/doc-auto-cfg.rs index 7842ee69c9f..b3fe8922fd7 100644 --- a/tests/rustdoc/doc-auto-cfg.rs +++ b/tests/rustdoc/doc-auto-cfg.rs @@ -1,35 +1,35 @@ #![feature(doc_auto_cfg)] #![crate_name = "foo"] -// @has foo/fn.foo.html -// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-meowmeow' +//@ has foo/fn.foo.html +//@ has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-meowmeow' #[cfg(not(meowmeow))] pub fn foo() {} -// @has foo/fn.bar.html -// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' -// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'test' -// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' -// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doctest' +//@ has foo/fn.bar.html +//@ has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' +//@ !has - '//*[@class="item-info"]/*[@class="stab portability"]' 'test' +//@ !has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' +//@ !has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doctest' #[cfg(any(meowmeow, test, doc, doctest))] pub fn bar() {} -// @has foo/fn.appear_1.html -// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' -// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' -// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-test' +//@ has foo/fn.appear_1.html +//@ has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' +//@ !has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' +//@ !has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-test' #[cfg(any(meowmeow, doc, not(test)))] pub fn appear_1() {} // issue #98065 -// @has foo/fn.appear_2.html -// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' -// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' -// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'test' +//@ has foo/fn.appear_2.html +//@ has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' +//@ !has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' +//@ !has - '//*[@class="item-info"]/*[@class="stab portability"]' 'test' #[cfg(any(meowmeow, doc, all(test)))] pub fn appear_2() {} // issue #98065 -// @has foo/fn.appear_3.html -// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' -// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' +//@ has foo/fn.appear_3.html +//@ has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' +//@ !has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' #[cfg(any(meowmeow, doc, all()))] pub fn appear_3() {} // issue #98065 diff --git a/tests/rustdoc/doc-cfg-hide.rs b/tests/rustdoc/doc-cfg-hide.rs index f80453d50ed..ceb1f99fae0 100644 --- a/tests/rustdoc/doc-cfg-hide.rs +++ b/tests/rustdoc/doc-cfg-hide.rs @@ -3,30 +3,30 @@ #![doc(cfg_hide(feature = "solecism"))] -// @has 'oud/struct.Solecism.html' -// @count - '//*[@class="stab portability"]' 0 +//@ has 'oud/struct.Solecism.html' +//@ count - '//*[@class="stab portability"]' 0 //@ compile-flags:--cfg feature="solecism" #[cfg(feature = "solecism")] pub struct Solecism; -// @has 'oud/struct.Scribacious.html' -// @count - '//*[@class="stab portability"]' 1 -// @matches - '//*[@class="stab portability"]' 'crate feature solecism' +//@ has 'oud/struct.Scribacious.html' +//@ count - '//*[@class="stab portability"]' 1 +//@ matches - '//*[@class="stab portability"]' 'crate feature solecism' #[cfg(feature = "solecism")] #[doc(cfg(feature = "solecism"))] pub struct Scribacious; -// @has 'oud/struct.Hyperdulia.html' -// @count - '//*[@class="stab portability"]' 1 -// @matches - '//*[@class="stab portability"]' 'crate feature hyperdulia' +//@ has 'oud/struct.Hyperdulia.html' +//@ count - '//*[@class="stab portability"]' 1 +//@ matches - '//*[@class="stab portability"]' 'crate feature hyperdulia' //@ compile-flags:--cfg feature="hyperdulia" #[cfg(feature = "solecism")] #[cfg(feature = "hyperdulia")] pub struct Hyperdulia; -// @has 'oud/struct.Oystercatcher.html' -// @count - '//*[@class="stab portability"]' 1 -// @matches - '//*[@class="stab portability"]' 'crate feature oystercatcher only' +//@ has 'oud/struct.Oystercatcher.html' +//@ count - '//*[@class="stab portability"]' 1 +//@ matches - '//*[@class="stab portability"]' 'crate feature oystercatcher only' //@ compile-flags:--cfg feature="oystercatcher" #[cfg(all(feature = "solecism", feature = "oystercatcher"))] pub struct Oystercatcher; diff --git a/tests/rustdoc/doc-cfg-implicit-gate.rs b/tests/rustdoc/doc-cfg-implicit-gate.rs index 15de15c0ce2..b5b8d0f427b 100644 --- a/tests/rustdoc/doc-cfg-implicit-gate.rs +++ b/tests/rustdoc/doc-cfg-implicit-gate.rs @@ -1,7 +1,7 @@ //@ compile-flags:--cfg feature="worricow" #![crate_name = "xenogenous"] -// @has 'xenogenous/struct.Worricow.html' -// @count - '//*[@class="stab portability"]' 0 +//@ has 'xenogenous/struct.Worricow.html' +//@ count - '//*[@class="stab portability"]' 0 #[cfg(feature = "worricow")] pub struct Worricow; diff --git a/tests/rustdoc/doc-cfg-implicit.rs b/tests/rustdoc/doc-cfg-implicit.rs index a6c0896db31..69b10867ee3 100644 --- a/tests/rustdoc/doc-cfg-implicit.rs +++ b/tests/rustdoc/doc-cfg-implicit.rs @@ -1,30 +1,30 @@ #![crate_name = "funambulism"] #![feature(doc_auto_cfg, doc_cfg)] -// @has 'funambulism/struct.Disorbed.html' -// @count - '//*[@class="stab portability"]' 1 -// @matches - '//*[@class="stab portability"]' 'crate feature disorbed' +//@ has 'funambulism/struct.Disorbed.html' +//@ count - '//*[@class="stab portability"]' 1 +//@ matches - '//*[@class="stab portability"]' 'crate feature disorbed' //@ compile-flags:--cfg feature="disorbed" #[cfg(feature = "disorbed")] pub struct Disorbed; -// @has 'funambulism/struct.Aesthesia.html' -// @count - '//*[@class="stab portability"]' 1 -// @matches - '//*[@class="stab portability"]' 'crate feature aesthesia' +//@ has 'funambulism/struct.Aesthesia.html' +//@ count - '//*[@class="stab portability"]' 1 +//@ matches - '//*[@class="stab portability"]' 'crate feature aesthesia' //@ compile-flags:--cfg feature="aesthesia" #[doc(cfg(feature = "aesthesia"))] pub struct Aesthesia; -// @has 'funambulism/struct.Pliothermic.html' -// @count - '//*[@class="stab portability"]' 1 -// @matches - '//*[@class="stab portability"]' 'crate feature pliothermic' +//@ has 'funambulism/struct.Pliothermic.html' +//@ count - '//*[@class="stab portability"]' 1 +//@ matches - '//*[@class="stab portability"]' 'crate feature pliothermic' //@ compile-flags:--cfg feature="epopoeist" #[cfg(feature = "epopoeist")] #[doc(cfg(feature = "pliothermic"))] pub struct Pliothermic; -// @has 'funambulism/struct.Simillimum.html' -// @count - '//*[@class="stab portability"]' 0 +//@ has 'funambulism/struct.Simillimum.html' +//@ count - '//*[@class="stab portability"]' 0 //@ compile-flags:--cfg feature="simillimum" #[cfg(feature = "simillimum")] #[doc(cfg(all()))] diff --git a/tests/rustdoc/doc-cfg-inherit-from-module-79201.rs b/tests/rustdoc/doc-cfg-inherit-from-module-79201.rs index 76260c4a502..256e3b0015c 100644 --- a/tests/rustdoc/doc-cfg-inherit-from-module-79201.rs +++ b/tests/rustdoc/doc-cfg-inherit-from-module-79201.rs @@ -3,13 +3,13 @@ #![feature(doc_cfg)] -// @has 'foo/trait.Foo.html' -// @count - '//*[@class="stab portability"]' 6 -// @matches - '//*[@class="stab portability"]' 'crate feature foo-root' -// @matches - '//*[@class="stab portability"]' 'crate feature foo-public-mod' -// @matches - '//*[@class="stab portability"]' 'crate feature foo-private-mod' -// @matches - '//*[@class="stab portability"]' 'crate feature foo-fn' -// @matches - '//*[@class="stab portability"]' 'crate feature foo-method' +//@ has 'foo/trait.Foo.html' +//@ count - '//*[@class="stab portability"]' 6 +//@ matches - '//*[@class="stab portability"]' 'crate feature foo-root' +//@ matches - '//*[@class="stab portability"]' 'crate feature foo-public-mod' +//@ matches - '//*[@class="stab portability"]' 'crate feature foo-private-mod' +//@ matches - '//*[@class="stab portability"]' 'crate feature foo-fn' +//@ matches - '//*[@class="stab portability"]' 'crate feature foo-method' pub trait Foo {} diff --git a/tests/rustdoc/doc-cfg-simplification.rs b/tests/rustdoc/doc-cfg-simplification.rs index 633df661be0..ce70de289c6 100644 --- a/tests/rustdoc/doc-cfg-simplification.rs +++ b/tests/rustdoc/doc-cfg-simplification.rs @@ -1,75 +1,75 @@ #![crate_name = "globuliferous"] #![feature(doc_cfg)] -// @has 'globuliferous/index.html' -// @count - '//*[@class="stab portability"]' 1 -// @matches - '//*[@class="stab portability"]' '^ratel$' +//@ has 'globuliferous/index.html' +//@ count - '//*[@class="stab portability"]' 1 +//@ matches - '//*[@class="stab portability"]' '^ratel$' -// @has 'globuliferous/ratel/index.html' -// @count - '//*[@class="stab portability"]' 8 -// @matches - '//*[@class="stab portability"]' 'crate feature ratel' -// @matches - '//*[@class="stab portability"]' '^zoonosology$' -// @matches - '//*[@class="stab portability"]' '^yusho$' -// @matches - '//*[@class="stab portability"]' '^nunciative$' -// @matches - '//*[@class="stab portability"]' '^thionic$' -// @matches - '//*[@class="stab portability"]' '^zincic$' -// @matches - '//*[@class="stab portability"]' '^cosmotellurian$' -// @matches - '//*[@class="stab portability"]' '^aposiopesis$' +//@ has 'globuliferous/ratel/index.html' +//@ count - '//*[@class="stab portability"]' 8 +//@ matches - '//*[@class="stab portability"]' 'crate feature ratel' +//@ matches - '//*[@class="stab portability"]' '^zoonosology$' +//@ matches - '//*[@class="stab portability"]' '^yusho$' +//@ matches - '//*[@class="stab portability"]' '^nunciative$' +//@ matches - '//*[@class="stab portability"]' '^thionic$' +//@ matches - '//*[@class="stab portability"]' '^zincic$' +//@ matches - '//*[@class="stab portability"]' '^cosmotellurian$' +//@ matches - '//*[@class="stab portability"]' '^aposiopesis$' #[doc(cfg(feature = "ratel"))] pub mod ratel { - // @has 'globuliferous/ratel/fn.ovicide.html' - // @count - '//*[@class="stab portability"]' 1 - // @matches - '//*[@class="stab portability"]' 'crate feature ratel' + //@ has 'globuliferous/ratel/fn.ovicide.html' + //@ count - '//*[@class="stab portability"]' 1 + //@ matches - '//*[@class="stab portability"]' 'crate feature ratel' pub fn ovicide() {} - // @has 'globuliferous/ratel/fn.zoonosology.html' - // @count - '//*[@class="stab portability"]' 1 - // @matches - '//*[@class="stab portability"]' 'crate features ratel and zoonosology' + //@ has 'globuliferous/ratel/fn.zoonosology.html' + //@ count - '//*[@class="stab portability"]' 1 + //@ matches - '//*[@class="stab portability"]' 'crate features ratel and zoonosology' #[doc(cfg(feature = "zoonosology"))] pub fn zoonosology() {} - // @has 'globuliferous/ratel/constant.DIAGRAPHICS.html' - // @count - '//*[@class="stab portability"]' 1 - // @matches - '//*[@class="stab portability"]' 'crate feature ratel' + //@ has 'globuliferous/ratel/constant.DIAGRAPHICS.html' + //@ count - '//*[@class="stab portability"]' 1 + //@ matches - '//*[@class="stab portability"]' 'crate feature ratel' pub const DIAGRAPHICS: () = (); - // @has 'globuliferous/ratel/constant.YUSHO.html' - // @count - '//*[@class="stab portability"]' 1 - // @matches - '//*[@class="stab portability"]' 'crate features ratel and yusho' + //@ has 'globuliferous/ratel/constant.YUSHO.html' + //@ count - '//*[@class="stab portability"]' 1 + //@ matches - '//*[@class="stab portability"]' 'crate features ratel and yusho' #[doc(cfg(feature = "yusho"))] pub const YUSHO: () = (); - // @has 'globuliferous/ratel/static.KEYBUGLE.html' - // @count - '//*[@class="stab portability"]' 1 - // @matches - '//*[@class="stab portability"]' 'crate feature ratel' + //@ has 'globuliferous/ratel/static.KEYBUGLE.html' + //@ count - '//*[@class="stab portability"]' 1 + //@ matches - '//*[@class="stab portability"]' 'crate feature ratel' pub static KEYBUGLE: () = (); - // @has 'globuliferous/ratel/static.NUNCIATIVE.html' - // @count - '//*[@class="stab portability"]' 1 - // @matches - '//*[@class="stab portability"]' 'crate features ratel and nunciative' + //@ has 'globuliferous/ratel/static.NUNCIATIVE.html' + //@ count - '//*[@class="stab portability"]' 1 + //@ matches - '//*[@class="stab portability"]' 'crate features ratel and nunciative' #[doc(cfg(feature = "nunciative"))] pub static NUNCIATIVE: () = (); - // @has 'globuliferous/ratel/type.Wrick.html' - // @count - '//*[@class="stab portability"]' 1 - // @matches - '//*[@class="stab portability"]' 'crate feature ratel' + //@ has 'globuliferous/ratel/type.Wrick.html' + //@ count - '//*[@class="stab portability"]' 1 + //@ matches - '//*[@class="stab portability"]' 'crate feature ratel' pub type Wrick = (); - // @has 'globuliferous/ratel/type.Thionic.html' - // @count - '//*[@class="stab portability"]' 1 - // @matches - '//*[@class="stab portability"]' 'crate features ratel and thionic' + //@ has 'globuliferous/ratel/type.Thionic.html' + //@ count - '//*[@class="stab portability"]' 1 + //@ matches - '//*[@class="stab portability"]' 'crate features ratel and thionic' #[doc(cfg(feature = "thionic"))] pub type Thionic = (); - // @has 'globuliferous/ratel/struct.Eventration.html' - // @count - '//*[@class="stab portability"]' 1 - // @matches - '//*[@class="stab portability"]' 'crate feature ratel' + //@ has 'globuliferous/ratel/struct.Eventration.html' + //@ count - '//*[@class="stab portability"]' 1 + //@ matches - '//*[@class="stab portability"]' 'crate feature ratel' pub struct Eventration; - // @has 'globuliferous/ratel/struct.Zincic.html' - // @count - '//*[@class="stab portability"]' 2 - // @matches - '//*[@class="stab portability"]' 'crate features ratel and zincic' - // @matches - '//*[@class="stab portability"]' 'crate feature rutherford' + //@ has 'globuliferous/ratel/struct.Zincic.html' + //@ count - '//*[@class="stab portability"]' 2 + //@ matches - '//*[@class="stab portability"]' 'crate features ratel and zincic' + //@ matches - '//*[@class="stab portability"]' 'crate feature rutherford' #[doc(cfg(feature = "zincic"))] pub struct Zincic { pub rectigrade: (), @@ -78,18 +78,18 @@ pub mod ratel { pub rutherford: (), } - // @has 'globuliferous/ratel/enum.Cosmotellurian.html' - // @count - '//*[@class="stab portability"]' 10 - // @matches - '//*[@class="stab portability"]' 'crate features ratel and cosmotellurian' - // @matches - '//*[@class="stab portability"]' 'crate feature biotaxy' - // @matches - '//*[@class="stab portability"]' 'crate feature xiphopagus' - // @matches - '//*[@class="stab portability"]' 'crate feature juxtapositive' - // @matches - '//*[@class="stab portability"]' 'crate feature fuero' - // @matches - '//*[@class="stab portability"]' 'crate feature palaeophile' - // @matches - '//*[@class="stab portability"]' 'crate feature broadcloth' - // @matches - '//*[@class="stab portability"]' 'crate features broadcloth and xanthocomic' - // @matches - '//*[@class="stab portability"]' 'crate feature broadcloth' - // @matches - '//*[@class="stab portability"]' 'crate features broadcloth and whosoever' + //@ has 'globuliferous/ratel/enum.Cosmotellurian.html' + //@ count - '//*[@class="stab portability"]' 10 + //@ matches - '//*[@class="stab portability"]' 'crate features ratel and cosmotellurian' + //@ matches - '//*[@class="stab portability"]' 'crate feature biotaxy' + //@ matches - '//*[@class="stab portability"]' 'crate feature xiphopagus' + //@ matches - '//*[@class="stab portability"]' 'crate feature juxtapositive' + //@ matches - '//*[@class="stab portability"]' 'crate feature fuero' + //@ matches - '//*[@class="stab portability"]' 'crate feature palaeophile' + //@ matches - '//*[@class="stab portability"]' 'crate feature broadcloth' + //@ matches - '//*[@class="stab portability"]' 'crate features broadcloth and xanthocomic' + //@ matches - '//*[@class="stab portability"]' 'crate feature broadcloth' + //@ matches - '//*[@class="stab portability"]' 'crate features broadcloth and whosoever' #[doc(cfg(feature = "cosmotellurian"))] pub enum Cosmotellurian { Groundsel { @@ -133,12 +133,12 @@ pub mod ratel { pub const WHOSOEVER: () = (); } - // @has 'globuliferous/ratel/trait.Gnotobiology.html' - // @count - '//*[@class="stab portability"]' 4 - // @matches - '//*[@class="stab portability"]' 'crate feature ratel' - // @matches - '//*[@class="stab portability"]' 'crate feature unzymotic' - // @matches - '//*[@class="stab portability"]' 'crate feature summate' - // @matches - '//*[@class="stab portability"]' 'crate feature unctuous' + //@ has 'globuliferous/ratel/trait.Gnotobiology.html' + //@ count - '//*[@class="stab portability"]' 4 + //@ matches - '//*[@class="stab portability"]' 'crate feature ratel' + //@ matches - '//*[@class="stab portability"]' 'crate feature unzymotic' + //@ matches - '//*[@class="stab portability"]' 'crate feature summate' + //@ matches - '//*[@class="stab portability"]' 'crate feature unctuous' pub trait Gnotobiology { const XYLOTHERAPY: (); @@ -156,12 +156,12 @@ pub mod ratel { fn unctuous(); } - // @has 'globuliferous/ratel/trait.Aposiopesis.html' - // @count - '//*[@class="stab portability"]' 4 - // @matches - '//*[@class="stab portability"]' 'crate features ratel and aposiopesis' - // @matches - '//*[@class="stab portability"]' 'crate feature umbracious' - // @matches - '//*[@class="stab portability"]' 'crate feature uakari' - // @matches - '//*[@class="stab portability"]' 'crate feature rotograph' + //@ has 'globuliferous/ratel/trait.Aposiopesis.html' + //@ count - '//*[@class="stab portability"]' 4 + //@ matches - '//*[@class="stab portability"]' 'crate features ratel and aposiopesis' + //@ matches - '//*[@class="stab portability"]' 'crate feature umbracious' + //@ matches - '//*[@class="stab portability"]' 'crate feature uakari' + //@ matches - '//*[@class="stab portability"]' 'crate feature rotograph' #[doc(cfg(feature = "aposiopesis"))] pub trait Aposiopesis { const REDHIBITION: (); diff --git a/tests/rustdoc/doc-cfg-traits.rs b/tests/rustdoc/doc-cfg-traits.rs index 13407b2c791..1256a7ae2c1 100644 --- a/tests/rustdoc/doc-cfg-traits.rs +++ b/tests/rustdoc/doc-cfg-traits.rs @@ -1,21 +1,21 @@ #![crate_name = "myrmecophagous"] #![feature(doc_cfg, associated_type_defaults)] -// @has 'myrmecophagous/index.html' -// @count - '//*[@class="stab portability"]' 2 -// @matches - '//*[@class="stab portability"]' '^jurisconsult$' -// @matches - '//*[@class="stab portability"]' '^quarter$' +//@ has 'myrmecophagous/index.html' +//@ count - '//*[@class="stab portability"]' 2 +//@ matches - '//*[@class="stab portability"]' '^jurisconsult$' +//@ matches - '//*[@class="stab portability"]' '^quarter$' pub trait Lea {} -// @has 'myrmecophagous/trait.Vortoscope.html' -// @count - '//*[@class="stab portability"]' 6 -// @matches - '//*[@class="stab portability"]' 'crate feature zibib' -// @matches - '//*[@class="stab portability"]' 'crate feature poriform' -// @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia' -// @matches - '//*[@class="stab portability"]' 'crate feature lea' -// @matches - '//*[@class="stab portability"]' 'crate feature unit' -// @matches - '//*[@class="stab portability"]' 'crate feature quarter' +//@ has 'myrmecophagous/trait.Vortoscope.html' +//@ count - '//*[@class="stab portability"]' 6 +//@ matches - '//*[@class="stab portability"]' 'crate feature zibib' +//@ matches - '//*[@class="stab portability"]' 'crate feature poriform' +//@ matches - '//*[@class="stab portability"]' 'crate feature ethopoeia' +//@ matches - '//*[@class="stab portability"]' 'crate feature lea' +//@ matches - '//*[@class="stab portability"]' 'crate feature unit' +//@ matches - '//*[@class="stab portability"]' 'crate feature quarter' pub trait Vortoscope { type Batology = (); @@ -39,15 +39,15 @@ impl Vortoscope for T {} #[doc(cfg(feature = "unit"))] impl Vortoscope for () {} -// @has 'myrmecophagous/trait.Jurisconsult.html' -// @count - '//*[@class="stab portability"]' 7 -// @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult' -// @matches - '//*[@class="stab portability"]' 'crate feature lithomancy' -// @matches - '//*[@class="stab portability"]' 'crate feature boodle' -// @matches - '//*[@class="stab portability"]' 'crate feature mistetch' -// @matches - '//*[@class="stab portability"]' 'crate feature lea' -// @matches - '//*[@class="stab portability"]' 'crate feature unit' -// @matches - '//*[@class="stab portability"]' 'crate feature quarter' +//@ has 'myrmecophagous/trait.Jurisconsult.html' +//@ count - '//*[@class="stab portability"]' 7 +//@ matches - '//*[@class="stab portability"]' 'crate feature jurisconsult' +//@ matches - '//*[@class="stab portability"]' 'crate feature lithomancy' +//@ matches - '//*[@class="stab portability"]' 'crate feature boodle' +//@ matches - '//*[@class="stab portability"]' 'crate feature mistetch' +//@ matches - '//*[@class="stab portability"]' 'crate feature lea' +//@ matches - '//*[@class="stab portability"]' 'crate feature unit' +//@ matches - '//*[@class="stab portability"]' 'crate feature quarter' #[doc(cfg(feature = "jurisconsult"))] pub trait Jurisconsult { type Urbanist = (); @@ -72,19 +72,19 @@ impl Jurisconsult for T {} #[doc(cfg(feature = "unit"))] impl Jurisconsult for () {} -// @has 'myrmecophagous/struct.Ultimogeniture.html' -// @count - '//*[@class="stab portability"]' 8 +//@ has 'myrmecophagous/struct.Ultimogeniture.html' +//@ count - '//*[@class="stab portability"]' 8 // -// @matches - '//*[@class="stab portability"]' 'crate feature zibib' -// @matches - '//*[@class="stab portability"]' 'crate feature poriform' -// @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia' +//@ matches - '//*[@class="stab portability"]' 'crate feature zibib' +//@ matches - '//*[@class="stab portability"]' 'crate feature poriform' +//@ matches - '//*[@class="stab portability"]' 'crate feature ethopoeia' // -// @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult' -// @matches - '//*[@class="stab portability"]' 'crate feature lithomancy' -// @matches - '//*[@class="stab portability"]' 'crate feature boodle' -// @matches - '//*[@class="stab portability"]' 'crate feature mistetch' +//@ matches - '//*[@class="stab portability"]' 'crate feature jurisconsult' +//@ matches - '//*[@class="stab portability"]' 'crate feature lithomancy' +//@ matches - '//*[@class="stab portability"]' 'crate feature boodle' +//@ matches - '//*[@class="stab portability"]' 'crate feature mistetch' // -// @matches - '//*[@class="stab portability"]' 'crate feature copy' +//@ matches - '//*[@class="stab portability"]' 'crate feature copy' #[derive(Clone)] pub struct Ultimogeniture; @@ -96,20 +96,20 @@ impl Jurisconsult for Ultimogeniture {} #[doc(cfg(feature = "copy"))] impl Copy for Ultimogeniture {} -// @has 'myrmecophagous/struct.Quarter.html' -// @count - '//*[@class="stab portability"]' 9 -// @matches - '//*[@class="stab portability"]' 'crate feature quarter' +//@ has 'myrmecophagous/struct.Quarter.html' +//@ count - '//*[@class="stab portability"]' 9 +//@ matches - '//*[@class="stab portability"]' 'crate feature quarter' // -// @matches - '//*[@class="stab portability"]' 'crate feature zibib' -// @matches - '//*[@class="stab portability"]' 'crate feature poriform' -// @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia' +//@ matches - '//*[@class="stab portability"]' 'crate feature zibib' +//@ matches - '//*[@class="stab portability"]' 'crate feature poriform' +//@ matches - '//*[@class="stab portability"]' 'crate feature ethopoeia' // -// @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult' -// @matches - '//*[@class="stab portability"]' 'crate feature lithomancy' -// @matches - '//*[@class="stab portability"]' 'crate feature boodle' -// @matches - '//*[@class="stab portability"]' 'crate feature mistetch' +//@ matches - '//*[@class="stab portability"]' 'crate feature jurisconsult' +//@ matches - '//*[@class="stab portability"]' 'crate feature lithomancy' +//@ matches - '//*[@class="stab portability"]' 'crate feature boodle' +//@ matches - '//*[@class="stab portability"]' 'crate feature mistetch' // -// @matches - '//*[@class="stab portability"]' 'crate feature copy' +//@ matches - '//*[@class="stab portability"]' 'crate feature copy' #[doc(cfg(feature = "quarter"))] #[derive(Clone)] pub struct Quarter; diff --git a/tests/rustdoc/doc-cfg.rs b/tests/rustdoc/doc-cfg.rs index c4702d4109e..6c973b5666b 100644 --- a/tests/rustdoc/doc-cfg.rs +++ b/tests/rustdoc/doc-cfg.rs @@ -1,33 +1,33 @@ #![feature(doc_cfg)] #![feature(target_feature, cfg_target_feature)] -// @has doc_cfg/struct.Portable.html -// @!has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' '' -// @has - '//*[@id="method.unix_and_arm_only_function"]' 'fn unix_and_arm_only_function()' -// @has - '//*[@class="stab portability"]' 'Available on Unix and ARM only.' -// @has - '//*[@id="method.wasi_and_wasm32_only_function"]' 'fn wasi_and_wasm32_only_function()' -// @has - '//*[@class="stab portability"]' 'Available on WASI and WebAssembly only.' +//@ has doc_cfg/struct.Portable.html +//@ !has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' '' +//@ has - '//*[@id="method.unix_and_arm_only_function"]' 'fn unix_and_arm_only_function()' +//@ has - '//*[@class="stab portability"]' 'Available on Unix and ARM only.' +//@ has - '//*[@id="method.wasi_and_wasm32_only_function"]' 'fn wasi_and_wasm32_only_function()' +//@ has - '//*[@class="stab portability"]' 'Available on WASI and WebAssembly only.' pub struct Portable; -// @has doc_cfg/unix_only/index.html \ +//@ has doc_cfg/unix_only/index.html \ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available on Unix only.' -// @matches - '//*[@class="item-name"]//*[@class="stab portability"]' '\AARM\Z' -// @count - '//*[@class="stab portability"]' 2 +//@ matches - '//*[@class="item-name"]//*[@class="stab portability"]' '\AARM\Z' +//@ count - '//*[@class="stab portability"]' 2 #[doc(cfg(unix))] pub mod unix_only { - // @has doc_cfg/unix_only/fn.unix_only_function.html \ + //@ has doc_cfg/unix_only/fn.unix_only_function.html \ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available on Unix only.' - // @count - '//*[@class="stab portability"]' 1 + //@ count - '//*[@class="stab portability"]' 1 pub fn unix_only_function() { content::should::be::irrelevant(); } - // @has doc_cfg/unix_only/trait.ArmOnly.html \ + //@ has doc_cfg/unix_only/trait.ArmOnly.html \ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available on Unix and ARM only.' - // @count - '//*[@class="stab portability"]' 1 + //@ count - '//*[@class="stab portability"]' 1 #[doc(cfg(target_arch = "arm"))] pub trait ArmOnly { fn unix_and_arm_only_function(); @@ -39,25 +39,25 @@ pub mod unix_only { } } -// @has doc_cfg/wasi_only/index.html \ +//@ has doc_cfg/wasi_only/index.html \ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available on WASI only.' -// @matches - '//*[@class="item-name"]//*[@class="stab portability"]' '\AWebAssembly\Z' -// @count - '//*[@class="stab portability"]' 2 +//@ matches - '//*[@class="item-name"]//*[@class="stab portability"]' '\AWebAssembly\Z' +//@ count - '//*[@class="stab portability"]' 2 #[doc(cfg(target_os = "wasi"))] pub mod wasi_only { - // @has doc_cfg/wasi_only/fn.wasi_only_function.html \ + //@ has doc_cfg/wasi_only/fn.wasi_only_function.html \ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available on WASI only.' - // @count - '//*[@class="stab portability"]' 1 + //@ count - '//*[@class="stab portability"]' 1 pub fn wasi_only_function() { content::should::be::irrelevant(); } - // @has doc_cfg/wasi_only/trait.Wasm32Only.html \ + //@ has doc_cfg/wasi_only/trait.Wasm32Only.html \ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available on WASI and WebAssembly only.' - // @count - '//*[@class="stab portability"]' 1 + //@ count - '//*[@class="stab portability"]' 1 #[doc(cfg(target_arch = "wasm32"))] pub trait Wasm32Only { fn wasi_and_wasm32_only_function(); @@ -73,19 +73,19 @@ pub mod wasi_only { // item as well // the portability header is different on the module view versus the full view -// @has doc_cfg/index.html -// @matches - '//*[@class="item-name"]//*[@class="stab portability"]' '\Aavx\Z' +//@ has doc_cfg/index.html +//@ matches - '//*[@class="item-name"]//*[@class="stab portability"]' '\Aavx\Z' -// @has doc_cfg/fn.uses_target_feature.html -// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ +//@ has doc_cfg/fn.uses_target_feature.html +//@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available with target feature avx only.' #[target_feature(enable = "avx")] pub unsafe fn uses_target_feature() { content::should::be::irrelevant(); } -// @has doc_cfg/fn.uses_cfg_target_feature.html -// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ +//@ has doc_cfg/fn.uses_cfg_target_feature.html +//@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available with target feature avx only.' #[doc(cfg(target_feature = "avx"))] pub fn uses_cfg_target_feature() { @@ -93,7 +93,7 @@ pub fn uses_cfg_target_feature() { } // multiple attributes should be allowed -// @has doc_cfg/fn.multiple_attrs.html \ +//@ has doc_cfg/fn.multiple_attrs.html \ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ // 'Available on x and y and z only.' #[doc(cfg(x))] diff --git a/tests/rustdoc/doc-hidden-method-13698.rs b/tests/rustdoc/doc-hidden-method-13698.rs index 44bf8bfd8d2..5c0ad18ee29 100644 --- a/tests/rustdoc/doc-hidden-method-13698.rs +++ b/tests/rustdoc/doc-hidden-method-13698.rs @@ -7,7 +7,7 @@ extern crate issue_13698; pub struct Foo; -// @!has issue_13698/struct.Foo.html '//*[@id="method.foo"]' 'fn foo' +//@ !has issue_13698/struct.Foo.html '//*[@id="method.foo"]' 'fn foo' impl issue_13698::Foo for Foo {} pub trait Bar { @@ -15,5 +15,5 @@ pub trait Bar { fn bar(&self) {} } -// @!has issue_13698/struct.Foo.html '//*[@id="method.bar"]' 'fn bar' +//@ !has issue_13698/struct.Foo.html '//*[@id="method.bar"]' 'fn bar' impl Bar for Foo {} diff --git a/tests/rustdoc/doc-hidden-private-67851-both.rs b/tests/rustdoc/doc-hidden-private-67851-both.rs index e6eb6a68ffd..2e2190d8755 100644 --- a/tests/rustdoc/doc-hidden-private-67851-both.rs +++ b/tests/rustdoc/doc-hidden-private-67851-both.rs @@ -2,9 +2,9 @@ // https://github.com/rust-lang/rust/issues/67851 #![crate_name="foo"] -// @has foo/struct.Hidden.html +//@ has foo/struct.Hidden.html #[doc(hidden)] pub struct Hidden; -// @has foo/struct.Private.html +//@ has foo/struct.Private.html struct Private; diff --git a/tests/rustdoc/doc-hidden-private-67851-hidden.rs b/tests/rustdoc/doc-hidden-private-67851-hidden.rs index 9767f9c84f9..a811a04a668 100644 --- a/tests/rustdoc/doc-hidden-private-67851-hidden.rs +++ b/tests/rustdoc/doc-hidden-private-67851-hidden.rs @@ -2,9 +2,9 @@ // https://github.com/rust-lang/rust/issues/67851 #![crate_name="foo"] -// @has foo/struct.Hidden.html +//@ has foo/struct.Hidden.html #[doc(hidden)] pub struct Hidden; -// @!has foo/struct.Private.html +//@ !has foo/struct.Private.html struct Private; diff --git a/tests/rustdoc/doc-hidden-private-67851-neither.rs b/tests/rustdoc/doc-hidden-private-67851-neither.rs index 6c6e84da43d..1f70ceefe44 100644 --- a/tests/rustdoc/doc-hidden-private-67851-neither.rs +++ b/tests/rustdoc/doc-hidden-private-67851-neither.rs @@ -1,9 +1,9 @@ // https://github.com/rust-lang/rust/issues/67851 #![crate_name="foo"] -// @!has foo/struct.Hidden.html +//@ !has foo/struct.Hidden.html #[doc(hidden)] pub struct Hidden; -// @!has foo/struct.Private.html +//@ !has foo/struct.Private.html struct Private; diff --git a/tests/rustdoc/doc-hidden-private-67851-private.rs b/tests/rustdoc/doc-hidden-private-67851-private.rs index 4aa39f5b789..f6f546ad5ea 100644 --- a/tests/rustdoc/doc-hidden-private-67851-private.rs +++ b/tests/rustdoc/doc-hidden-private-67851-private.rs @@ -2,9 +2,9 @@ // https://github.com/rust-lang/rust/issues/67851 #![crate_name="foo"] -// @!has foo/struct.Hidden.html +//@ !has foo/struct.Hidden.html #[doc(hidden)] pub struct Hidden; -// @has foo/struct.Private.html +//@ has foo/struct.Private.html struct Private; diff --git a/tests/rustdoc/doc-hidden-trait-implementors-33069.rs b/tests/rustdoc/doc-hidden-trait-implementors-33069.rs index 35570668ea1..d5ee3d09276 100644 --- a/tests/rustdoc/doc-hidden-trait-implementors-33069.rs +++ b/tests/rustdoc/doc-hidden-trait-implementors-33069.rs @@ -8,6 +8,6 @@ pub mod hidden { pub struct Foo; } -// @has issue_33069/trait.Bar.html -// @!has - '//code' 'impl Bar for Foo' +//@ has issue_33069/trait.Bar.html +//@ !has - '//code' 'impl Bar for Foo' impl Bar for hidden::Foo {} diff --git a/tests/rustdoc/doc_auto_cfg_nested_impl.rs b/tests/rustdoc/doc_auto_cfg_nested_impl.rs index 4d73e0d829a..f85d7b23637 100644 --- a/tests/rustdoc/doc_auto_cfg_nested_impl.rs +++ b/tests/rustdoc/doc_auto_cfg_nested_impl.rs @@ -8,8 +8,8 @@ pub struct S; pub trait MyTrait1 {} pub trait MyTrait2 {} -// @has foo/struct.S.html -// @has - '//*[@id="impl-MyTrait1-for-S"]//*[@class="stab portability"]' \ +//@ has foo/struct.S.html +//@ has - '//*[@id="impl-MyTrait1-for-S"]//*[@class="stab portability"]' \ // 'Available on non-crate feature coolstuff only.' #[cfg(not(feature = "coolstuff"))] impl MyTrait1 for S {} @@ -18,7 +18,7 @@ impl MyTrait1 for S {} mod submod { use crate::{S, MyTrait2}; // This impl should also have the `not(feature = "coolstuff")`. - // @has - '//*[@id="impl-MyTrait2-for-S"]//*[@class="stab portability"]' \ + //@ has - '//*[@id="impl-MyTrait2-for-S"]//*[@class="stab portability"]' \ // 'Available on non-crate feature coolstuff only.' impl MyTrait2 for S {} } diff --git a/tests/rustdoc/doctest/doctest-escape-boring-41783.rs b/tests/rustdoc/doctest/doctest-escape-boring-41783.rs index 7782e148fd9..2d614f63da6 100644 --- a/tests/rustdoc/doctest/doctest-escape-boring-41783.rs +++ b/tests/rustdoc/doctest/doctest-escape-boring-41783.rs @@ -1,14 +1,14 @@ // https://github.com/rust-lang/rust/issues/41783 #![crate_name="foo"] -// @has foo/struct.Foo.html -// @!hasraw - 'space' -// @!hasraw - 'comment' -// @hasraw - '#[outer]' -// @!hasraw - '#[outer]' -// @hasraw - '#![inner]' -// @!hasraw - '#![inner]' -// @snapshot 'codeblock' - '//*[@class="toggle top-doc"]/*[@class="docblock"]//pre/code' +//@ has foo/struct.Foo.html +//@ !hasraw - 'space' +//@ !hasraw - 'comment' +//@ hasraw - '#[outer]' +//@ !hasraw - '#[outer]' +//@ hasraw - '#![inner]' +//@ !hasraw - '#![inner]' +//@ snapshot 'codeblock' - '//*[@class="toggle top-doc"]/*[@class="docblock"]//pre/code' /// ```no_run /// # # space diff --git a/tests/rustdoc/document-hidden-items-15347.rs b/tests/rustdoc/document-hidden-items-15347.rs index bf3c73f0ba1..ee19e793020 100644 --- a/tests/rustdoc/document-hidden-items-15347.rs +++ b/tests/rustdoc/document-hidden-items-15347.rs @@ -3,6 +3,6 @@ #![crate_name="issue_15347"] -// @has issue_15347/fn.foo.html +//@ has issue_15347/fn.foo.html #[doc(hidden)] pub fn foo() {} diff --git a/tests/rustdoc/double-hyphen-to-dash.rs b/tests/rustdoc/double-hyphen-to-dash.rs index 66905f90cfc..009de4faf41 100644 --- a/tests/rustdoc/double-hyphen-to-dash.rs +++ b/tests/rustdoc/double-hyphen-to-dash.rs @@ -2,8 +2,8 @@ #![crate_name = "foo"] -// @has 'foo/index.html' '//*[@class="desc docblock-short"]' '–' -// @has 'foo/struct.Bar.html' '//*[@class="docblock"]' '–' +//@ has 'foo/index.html' '//*[@class="desc docblock-short"]' '–' +//@ has 'foo/struct.Bar.html' '//*[@class="docblock"]' '–' /// -- pub struct Bar; diff --git a/tests/rustdoc/double-quote-escape.rs b/tests/rustdoc/double-quote-escape.rs index 4f4436377a0..9c8fb8fc6da 100644 --- a/tests/rustdoc/double-quote-escape.rs +++ b/tests/rustdoc/double-quote-escape.rs @@ -6,6 +6,6 @@ pub trait Foo { pub struct Bar; -// @has foo/struct.Bar.html -// @has - '//*[@class="sidebar-elems"]//section//a[@href="#impl-Foo%3Cunsafe+extern+%22C%22+fn()%3E-for-Bar"]' 'Foo' +//@ has foo/struct.Bar.html +//@ has - '//*[@class="sidebar-elems"]//section//a[@href="#impl-Foo%3Cunsafe+extern+%22C%22+fn()%3E-for-Bar"]' 'Foo' impl Foo for Bar {} diff --git a/tests/rustdoc/duplicate-cfg.rs b/tests/rustdoc/duplicate-cfg.rs index 12846c5c17a..87c089e9735 100644 --- a/tests/rustdoc/duplicate-cfg.rs +++ b/tests/rustdoc/duplicate-cfg.rs @@ -1,53 +1,53 @@ #![crate_name = "foo"] #![feature(doc_cfg)] -// @has 'foo/index.html' -// @matches '-' '//*[@class="item-name"]//*[@class="stab portability"]' '^sync$' -// @has '-' '//*[@class="item-name"]//*[@class="stab portability"]/@title' 'Available on crate feature `sync` only' +//@ has 'foo/index.html' +//@ matches '-' '//*[@class="item-name"]//*[@class="stab portability"]' '^sync$' +//@ has '-' '//*[@class="item-name"]//*[@class="stab portability"]/@title' 'Available on crate feature `sync` only' -// @has 'foo/struct.Foo.html' -// @has '-' '//*[@class="stab portability"]' 'sync' +//@ has 'foo/struct.Foo.html' +//@ has '-' '//*[@class="stab portability"]' 'sync' #[doc(cfg(feature = "sync"))] #[doc(cfg(feature = "sync"))] /// my feature sync struct pub struct Foo; -// @has 'foo/bar/index.html' -// @has '-' '//*[@class="stab portability"]' 'Available on crate feature sync only.' +//@ has 'foo/bar/index.html' +//@ has '-' '//*[@class="stab portability"]' 'Available on crate feature sync only.' #[doc(cfg(feature = "sync"))] pub mod bar { - // @has 'foo/bar/struct.Bar.html' - // @has '-' '//*[@class="stab portability"]' 'Available on crate feature sync only.' + //@ has 'foo/bar/struct.Bar.html' + //@ has '-' '//*[@class="stab portability"]' 'Available on crate feature sync only.' #[doc(cfg(feature = "sync"))] pub struct Bar; } -// @has 'foo/baz/index.html' -// @has '-' '//*[@class="stab portability"]' 'Available on crate features sync and send only.' +//@ has 'foo/baz/index.html' +//@ has '-' '//*[@class="stab portability"]' 'Available on crate features sync and send only.' #[doc(cfg(all(feature = "sync", feature = "send")))] pub mod baz { - // @has 'foo/baz/struct.Baz.html' - // @has '-' '//*[@class="stab portability"]' 'Available on crate features sync and send only.' + //@ has 'foo/baz/struct.Baz.html' + //@ has '-' '//*[@class="stab portability"]' 'Available on crate features sync and send only.' #[doc(cfg(feature = "sync"))] pub struct Baz; } -// @has 'foo/qux/index.html' -// @has '-' '//*[@class="stab portability"]' 'Available on crate feature sync only.' +//@ has 'foo/qux/index.html' +//@ has '-' '//*[@class="stab portability"]' 'Available on crate feature sync only.' #[doc(cfg(feature = "sync"))] pub mod qux { - // @has 'foo/qux/struct.Qux.html' - // @has '-' '//*[@class="stab portability"]' 'Available on crate features sync and send only.' + //@ has 'foo/qux/struct.Qux.html' + //@ has '-' '//*[@class="stab portability"]' 'Available on crate features sync and send only.' #[doc(cfg(all(feature = "sync", feature = "send")))] pub struct Qux; } -// @has 'foo/quux/index.html' -// @has '-' '//*[@class="stab portability"]' 'Available on crate feature sync and crate feature send and foo only.' +//@ has 'foo/quux/index.html' +//@ has '-' '//*[@class="stab portability"]' 'Available on crate feature sync and crate feature send and foo only.' #[doc(cfg(all(feature = "sync", feature = "send", foo)))] pub mod quux { - // @has 'foo/quux/struct.Quux.html' - // @has '-' '//*[@class="stab portability"]' 'Available on crate feature sync and crate feature send and foo and bar only.' + //@ has 'foo/quux/struct.Quux.html' + //@ has '-' '//*[@class="stab portability"]' 'Available on crate feature sync and crate feature send and foo and bar only.' #[doc(cfg(all(feature = "send", feature = "sync", bar)))] pub struct Quux; } diff --git a/tests/rustdoc/duplicate-flags.rs b/tests/rustdoc/duplicate-flags.rs index c0df181397b..230eedfba62 100644 --- a/tests/rustdoc/duplicate-flags.rs +++ b/tests/rustdoc/duplicate-flags.rs @@ -1,4 +1,4 @@ //@ compile-flags: --document-private-items --document-private-items -// @has duplicate_flags/struct.Private.html +//@ has duplicate_flags/struct.Private.html struct Private; diff --git a/tests/rustdoc/duplicate_impls/issue-33054.rs b/tests/rustdoc/duplicate_impls/issue-33054.rs index 4c2071b8322..24ff30668cf 100644 --- a/tests/rustdoc/duplicate_impls/issue-33054.rs +++ b/tests/rustdoc/duplicate_impls/issue-33054.rs @@ -1,13 +1,13 @@ // ignore-tidy-linelength -// @has issue_33054/impls/struct.Foo.html -// @has - '//h3[@class="code-header"]' 'impl Foo' -// @has - '//h3[@class="code-header"]' 'impl Bar for Foo' -// @count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1 -// @count - '//*[@id="main-content"]/div[@id="implementations-list"]/details/summary/*[@class="impl"]' 1 -// @has issue_33054/impls/bar/trait.Bar.html -// @has - '//h3[@class="code-header"]' 'impl Bar for Foo' -// @count - '//*[@class="struct"]' 1 +//@ has issue_33054/impls/struct.Foo.html +//@ has - '//h3[@class="code-header"]' 'impl Foo' +//@ has - '//h3[@class="code-header"]' 'impl Bar for Foo' +//@ count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1 +//@ count - '//*[@id="main-content"]/div[@id="implementations-list"]/details/summary/*[@class="impl"]' 1 +//@ has issue_33054/impls/bar/trait.Bar.html +//@ has - '//h3[@class="code-header"]' 'impl Bar for Foo' +//@ count - '//*[@class="struct"]' 1 pub mod impls; #[doc(inline)] diff --git a/tests/rustdoc/duplicated-glob-reexport-60522.rs b/tests/rustdoc/duplicated-glob-reexport-60522.rs index 50def2c3cd9..a75a21c2dac 100644 --- a/tests/rustdoc/duplicated-glob-reexport-60522.rs +++ b/tests/rustdoc/duplicated-glob-reexport-60522.rs @@ -4,14 +4,14 @@ #![crate_name = "foo"] -// @has 'foo/index.html' -// @count - '//*[@id="main-content"]/*[@class="section-header"]' 1 -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Modules' -// @count - '//*[@id="main-content"]/*[@class="item-table"]//*[@class="mod"]' 2 -// @has - '//*[@id="main-content"]//*[@class="mod"]' 'banana' -// @has - '//*[@id="main-content"]//*[@href="banana/index.html"]' 'banana' -// @has - '//*[@id="main-content"]//*[@class="mod"]' 'peach' -// @has - '//*[@id="main-content"]//*[@href="peach/index.html"]' 'peach' +//@ has 'foo/index.html' +//@ count - '//*[@id="main-content"]/*[@class="section-header"]' 1 +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Modules' +//@ count - '//*[@id="main-content"]/*[@class="item-table"]//*[@class="mod"]' 2 +//@ has - '//*[@id="main-content"]//*[@class="mod"]' 'banana' +//@ has - '//*[@id="main-content"]//*[@href="banana/index.html"]' 'banana' +//@ has - '//*[@id="main-content"]//*[@class="mod"]' 'peach' +//@ has - '//*[@id="main-content"]//*[@href="peach/index.html"]' 'peach' pub use crate::my_crate::*; @@ -24,16 +24,16 @@ mod my_crate { } } -// @has 'foo/banana/index.html' -// @count - '//*[@id="main-content"]//*[@class="struct"]' 1 -// @has - '//*[@id="main-content"]//*[@class="struct"]' 'Brown' +//@ has 'foo/banana/index.html' +//@ count - '//*[@id="main-content"]//*[@class="struct"]' 1 +//@ has - '//*[@id="main-content"]//*[@class="struct"]' 'Brown' pub mod banana { pub struct Brown; } -// @has 'foo/peach/index.html' -// @count - '//*[@id="main-content"]//*[@class="struct"]' 1 -// @has - '//*[@id="main-content"]//*[@class="struct"]' 'Pungent' +//@ has 'foo/peach/index.html' +//@ count - '//*[@id="main-content"]//*[@class="struct"]' 1 +//@ has - '//*[@id="main-content"]//*[@class="struct"]' 'Pungent' pub mod peach { pub struct Pungent; } diff --git a/tests/rustdoc/duplicated_impl.rs b/tests/rustdoc/duplicated_impl.rs index f32cf310055..e7828885cc1 100644 --- a/tests/rustdoc/duplicated_impl.rs +++ b/tests/rustdoc/duplicated_impl.rs @@ -6,8 +6,8 @@ // We check that there is only one "impl Something for T" listed in the // blanket implementations. -// @has 'foo/struct.Whatever.html' -// @count - '//*[@id="blanket-implementations-list"]/section[@class="impl"]' 1 +//@ has 'foo/struct.Whatever.html' +//@ count - '//*[@id="blanket-implementations-list"]/section[@class="impl"]' 1 pub trait Something { } pub struct Whatever; diff --git a/tests/rustdoc/early-unindent.rs b/tests/rustdoc/early-unindent.rs index 791a452c957..33342aaee0e 100644 --- a/tests/rustdoc/early-unindent.rs +++ b/tests/rustdoc/early-unindent.rs @@ -6,8 +6,8 @@ pub mod app { pub struct S; impl S { - // @has 'foo/app/struct.S.html' - // @has - '//a[@href="../enums/enum.Foo.html#method.by_name"]' 'Foo::by_name' + //@ has 'foo/app/struct.S.html' + //@ has - '//a[@href="../enums/enum.Foo.html#method.by_name"]' 'Foo::by_name' /** Doc comment hello! [`Foo::by_name`](`crate::enums::Foo::by_name`). */ diff --git a/tests/rustdoc/elided-lifetime.rs b/tests/rustdoc/elided-lifetime.rs index 4df381a6f68..259325762c6 100644 --- a/tests/rustdoc/elided-lifetime.rs +++ b/tests/rustdoc/elided-lifetime.rs @@ -10,34 +10,34 @@ pub struct Ref<'a>(&'a u32); type ARef<'a> = Ref<'a>; -// @has foo/fn.test1.html -// @matchesraw - "Ref<'_>" +//@ has foo/fn.test1.html +//@ matchesraw - "Ref<'_>" pub fn test1(a: &u32) -> Ref { Ref(a) } -// @has foo/fn.test2.html -// @matchesraw - "Ref<'_>" +//@ has foo/fn.test2.html +//@ matchesraw - "Ref<'_>" pub fn test2(a: &u32) -> Ref<'_> { Ref(a) } -// @has foo/fn.test3.html -// @matchesraw - "Ref<'_>" +//@ has foo/fn.test3.html +//@ matchesraw - "Ref<'_>" pub fn test3(a: &u32) -> ARef { Ref(a) } -// @has foo/fn.test4.html -// @matchesraw - "Ref<'_>" +//@ has foo/fn.test4.html +//@ matchesraw - "Ref<'_>" pub fn test4(a: &u32) -> ARef<'_> { Ref(a) } // Ensure external paths in inlined docs also display elided lifetime -// @has foo/bar/fn.test5.html -// @matchesraw - "Ref<'_>" -// @has foo/bar/fn.test6.html -// @matchesraw - "Ref<'_>" +//@ has foo/bar/fn.test5.html +//@ matchesraw - "Ref<'_>" +//@ has foo/bar/fn.test6.html +//@ matchesraw - "Ref<'_>" #[doc(inline)] pub extern crate bar; diff --git a/tests/rustdoc/empty-impl-block-private-with-doc.rs b/tests/rustdoc/empty-impl-block-private-with-doc.rs index 21c860c0923..5dc7e1aed7a 100644 --- a/tests/rustdoc/empty-impl-block-private-with-doc.rs +++ b/tests/rustdoc/empty-impl-block-private-with-doc.rs @@ -4,13 +4,13 @@ #![allow(incomplete_features)] #![crate_name = "foo"] -// @has 'foo/struct.Foo.html' +//@ has 'foo/struct.Foo.html' pub struct Foo; // There are 3 impl blocks with public item and one that should not be displayed // by default because it only contains private items (but not in this case because // we used `--document-private-items`). -// @count - '//*[@class="impl"]' 'impl Foo' 4 +//@ count - '//*[@class="impl"]' 'impl Foo' 4 // Impl block only containing private items should not be displayed unless the // `--document-private-items` flag is used. diff --git a/tests/rustdoc/empty-impl-block-private.rs b/tests/rustdoc/empty-impl-block-private.rs index d44b4a47cee..2ee65d1a969 100644 --- a/tests/rustdoc/empty-impl-block-private.rs +++ b/tests/rustdoc/empty-impl-block-private.rs @@ -2,12 +2,12 @@ #![allow(incomplete_features)] #![crate_name = "foo"] -// @has 'foo/struct.Foo.html' +//@ has 'foo/struct.Foo.html' pub struct Foo; // There are 3 impl blocks with public item and one that should not be displayed // because it only contains private items. -// @count - '//*[@class="impl"]' 'impl Foo' 3 +//@ count - '//*[@class="impl"]' 'impl Foo' 3 // Impl block only containing private items should not be displayed. /// Private diff --git a/tests/rustdoc/empty-impl-block.rs b/tests/rustdoc/empty-impl-block.rs index da780580bd0..91fd4a64ef9 100644 --- a/tests/rustdoc/empty-impl-block.rs +++ b/tests/rustdoc/empty-impl-block.rs @@ -1,20 +1,20 @@ #![crate_name = "foo"] -// @has 'foo/struct.Foo.html' +//@ has 'foo/struct.Foo.html' pub struct Foo; -// @has - '//*[@class="docblock"]' 'Hello empty impl block!' -// @has - '//*[@class="item-info"]' 'This impl block contains no items.' +//@ has - '//*[@class="docblock"]' 'Hello empty impl block!' +//@ has - '//*[@class="item-info"]' 'This impl block contains no items.' /// Hello empty impl block! impl Foo {} // We ensure that this empty impl block without doc isn't rendered. -// @count - '//*[@class="impl"]' 'impl Foo' 1 +//@ count - '//*[@class="impl"]' 'impl Foo' 1 impl Foo {} // Just to ensure that empty trait impl blocks are rendered. pub struct Another; pub trait Bar {} -// @has 'foo/struct.Another.html' -// @has - '//h3[@class="code-header"]' 'impl Bar for Another' +//@ has 'foo/struct.Another.html' +//@ has - '//h3[@class="code-header"]' 'impl Bar for Another' impl Bar for Another {} diff --git a/tests/rustdoc/empty-impls.rs b/tests/rustdoc/empty-impls.rs index 83902d6f7ab..912a8d3d913 100644 --- a/tests/rustdoc/empty-impls.rs +++ b/tests/rustdoc/empty-impls.rs @@ -1,19 +1,19 @@ #![crate_name = "foo"] -// @has foo/struct.Foo.html -// @has - '//div[@id="synthetic-implementations-list"]/*[@id="impl-Send-for-Foo"]' 'impl Send for Foo' +//@ has foo/struct.Foo.html +//@ has - '//div[@id="synthetic-implementations-list"]/*[@id="impl-Send-for-Foo"]' 'impl Send for Foo' pub struct Foo; pub trait EmptyTrait {} -// @has - '//div[@id="trait-implementations-list"]/*[@id="impl-EmptyTrait-for-Foo"]' 'impl EmptyTrait for Foo' +//@ has - '//div[@id="trait-implementations-list"]/*[@id="impl-EmptyTrait-for-Foo"]' 'impl EmptyTrait for Foo' impl EmptyTrait for Foo {} pub trait NotEmpty { fn foo(&self); } -// @has - '//div[@id="trait-implementations-list"]/details/summary/*[@id="impl-NotEmpty-for-Foo"]' 'impl NotEmpty for Foo' +//@ has - '//div[@id="trait-implementations-list"]/details/summary/*[@id="impl-NotEmpty-for-Foo"]' 'impl NotEmpty for Foo' impl NotEmpty for Foo { fn foo(&self) {} } diff --git a/tests/rustdoc/empty-mod-private.rs b/tests/rustdoc/empty-mod-private.rs index 7e78aac1764..4e408e3d424 100644 --- a/tests/rustdoc/empty-mod-private.rs +++ b/tests/rustdoc/empty-mod-private.rs @@ -1,16 +1,16 @@ //@ compile-flags: --document-private-items -// @has 'empty_mod_private/index.html' '//a[@href="foo/index.html"]' 'foo' -// @hasraw 'empty_mod_private/sidebar-items.js' 'foo' -// @matches 'empty_mod_private/foo/index.html' '//h1' 'Module empty_mod_private::foo' +//@ has 'empty_mod_private/index.html' '//a[@href="foo/index.html"]' 'foo' +//@ hasraw 'empty_mod_private/sidebar-items.js' 'foo' +//@ matches 'empty_mod_private/foo/index.html' '//h1' 'Module empty_mod_private::foo' mod foo {} -// @has 'empty_mod_private/index.html' '//a[@href="bar/index.html"]' 'bar' -// @hasraw 'empty_mod_private/sidebar-items.js' 'bar' -// @matches 'empty_mod_private/bar/index.html' '//h1' 'Module empty_mod_private::bar' +//@ has 'empty_mod_private/index.html' '//a[@href="bar/index.html"]' 'bar' +//@ hasraw 'empty_mod_private/sidebar-items.js' 'bar' +//@ matches 'empty_mod_private/bar/index.html' '//h1' 'Module empty_mod_private::bar' mod bar { - // @has 'empty_mod_private/bar/index.html' '//a[@href="baz/index.html"]' 'baz' - // @hasraw 'empty_mod_private/bar/sidebar-items.js' 'baz' - // @matches 'empty_mod_private/bar/baz/index.html' '//h1' 'Module empty_mod_private::bar::baz' + //@ has 'empty_mod_private/bar/index.html' '//a[@href="baz/index.html"]' 'baz' + //@ hasraw 'empty_mod_private/bar/sidebar-items.js' 'baz' + //@ matches 'empty_mod_private/bar/baz/index.html' '//h1' 'Module empty_mod_private::bar::baz' mod baz {} } diff --git a/tests/rustdoc/empty-mod-public.rs b/tests/rustdoc/empty-mod-public.rs index c0bac40212c..b5a63525524 100644 --- a/tests/rustdoc/empty-mod-public.rs +++ b/tests/rustdoc/empty-mod-public.rs @@ -1,14 +1,14 @@ -// @has 'empty_mod_public/index.html' '//a[@href="foo/index.html"]' 'foo' -// @hasraw 'empty_mod_public/sidebar-items.js' 'foo' -// @matches 'empty_mod_public/foo/index.html' '//h1' 'Module empty_mod_public::foo' +//@ has 'empty_mod_public/index.html' '//a[@href="foo/index.html"]' 'foo' +//@ hasraw 'empty_mod_public/sidebar-items.js' 'foo' +//@ matches 'empty_mod_public/foo/index.html' '//h1' 'Module empty_mod_public::foo' pub mod foo {} -// @has 'empty_mod_public/index.html' '//a[@href="bar/index.html"]' 'bar' -// @hasraw 'empty_mod_public/sidebar-items.js' 'bar' -// @matches 'empty_mod_public/bar/index.html' '//h1' 'Module empty_mod_public::bar' +//@ has 'empty_mod_public/index.html' '//a[@href="bar/index.html"]' 'bar' +//@ hasraw 'empty_mod_public/sidebar-items.js' 'bar' +//@ matches 'empty_mod_public/bar/index.html' '//h1' 'Module empty_mod_public::bar' pub mod bar { - // @has 'empty_mod_public/bar/index.html' '//a[@href="baz/index.html"]' 'baz' - // @hasraw 'empty_mod_public/bar/sidebar-items.js' 'baz' - // @matches 'empty_mod_public/bar/baz/index.html' '//h1' 'Module empty_mod_public::bar::baz' + //@ has 'empty_mod_public/bar/index.html' '//a[@href="baz/index.html"]' 'baz' + //@ hasraw 'empty_mod_public/bar/sidebar-items.js' 'baz' + //@ matches 'empty_mod_public/bar/baz/index.html' '//h1' 'Module empty_mod_public::bar::baz' pub mod baz {} } diff --git a/tests/rustdoc/empty-section.rs b/tests/rustdoc/empty-section.rs index 0d6afb0e444..71ebc66d695 100644 --- a/tests/rustdoc/empty-section.rs +++ b/tests/rustdoc/empty-section.rs @@ -3,8 +3,8 @@ pub struct Foo; -// @has foo/struct.Foo.html -// @!hasraw - 'Auto Trait Implementations' +//@ has foo/struct.Foo.html +//@ !hasraw - 'Auto Trait Implementations' impl !Send for Foo {} impl !Sync for Foo {} impl !std::marker::Freeze for Foo {} diff --git a/tests/rustdoc/ensure-src-link.rs b/tests/rustdoc/ensure-src-link.rs index f95b5f2d424..4156fdcba59 100644 --- a/tests/rustdoc/ensure-src-link.rs +++ b/tests/rustdoc/ensure-src-link.rs @@ -2,5 +2,5 @@ // This test ensures that the [src] link is present on traits items. -// @has foo/trait.Iterator.html '//*[@id="method.zip"]//a[@class="src"]' "source" +//@ has foo/trait.Iterator.html '//*[@id="method.zip"]//a[@class="src"]' "source" pub use std::iter::Iterator; diff --git a/tests/rustdoc/enum-headings.rs b/tests/rustdoc/enum-headings.rs index 2e5c34391c4..6deabf1cd9a 100644 --- a/tests/rustdoc/enum-headings.rs +++ b/tests/rustdoc/enum-headings.rs @@ -1,25 +1,25 @@ #![crate_name = "foo"] -// @has foo/enum.Token.html +//@ has foo/enum.Token.html /// A token! /// # First /// Some following text... -// @has - '//h2[@id="first"]' "First" +//@ has - '//h2[@id="first"]' "First" pub enum Token { /// A declaration! /// # Variant-First /// Some following text... - // @has - '//h4[@id="variant-first"]' "Variant-First" + //@ has - '//h4[@id="variant-first"]' "Variant-First" Declaration { /// A version! /// # Variant-Field-First /// Some following text... - // @has - '//h5[@id="variant-field-first"]' "Variant-Field-First" + //@ has - '//h5[@id="variant-field-first"]' "Variant-Field-First" version: String, }, /// A Zoople! /// # Variant-First Zoople( - // @has - '//h5[@id="variant-tuple-field-first"]' "Variant-Tuple-Field-First" + //@ has - '//h5[@id="variant-tuple-field-first"]' "Variant-Tuple-Field-First" /// Zoople's first variant! /// # Variant-Tuple-Field-First /// Some following text... @@ -28,13 +28,13 @@ pub enum Token { /// Unfinished business! /// # Non-Exhaustive-First /// Some following text... - // @has - '//h4[@id="non-exhaustive-first"]' "Non-Exhaustive-First" + //@ has - '//h4[@id="non-exhaustive-first"]' "Non-Exhaustive-First" #[non_exhaustive] Unfinished { /// This is x. /// # X-First /// Some following text... - // @has - '//h5[@id="x-first"]' "X-First" + //@ has - '//h5[@id="x-first"]' "X-First" x: usize, }, } diff --git a/tests/rustdoc/enum-variant-doc-hidden-field-88600.rs b/tests/rustdoc/enum-variant-doc-hidden-field-88600.rs index 31d96e9db75..f1d461c66c3 100644 --- a/tests/rustdoc/enum-variant-doc-hidden-field-88600.rs +++ b/tests/rustdoc/enum-variant-doc-hidden-field-88600.rs @@ -8,26 +8,26 @@ pub struct H; // Denotes a field which should not be hidden (shown). pub struct S; -// @has foo/enum.FooEnum.html +//@ has foo/enum.FooEnum.html pub enum FooEnum { - // @has - '//*[@id="variant.HiddenTupleItem"]//h3' 'HiddenTupleItem(/* private fields */)' - // @count - '//*[@id="variant.HiddenTupleItem.field.0"]' 0 + //@ has - '//*[@id="variant.HiddenTupleItem"]//h3' 'HiddenTupleItem(/* private fields */)' + //@ count - '//*[@id="variant.HiddenTupleItem.field.0"]' 0 HiddenTupleItem(#[doc(hidden)] H), - // @has - '//*[@id="variant.MultipleHidden"]//h3' 'MultipleHidden(/* private fields */)' - // @count - '//*[@id="variant.MultipleHidden.field.0"]' 0 - // @count - '//*[@id="variant.MultipleHidden.field.1"]' 0 + //@ has - '//*[@id="variant.MultipleHidden"]//h3' 'MultipleHidden(/* private fields */)' + //@ count - '//*[@id="variant.MultipleHidden.field.0"]' 0 + //@ count - '//*[@id="variant.MultipleHidden.field.1"]' 0 MultipleHidden(#[doc(hidden)] H, #[doc(hidden)] H), - // @has - '//*[@id="variant.MixedHiddenFirst"]//h3' 'MixedHiddenFirst(_, S)' - // @count - '//*[@id="variant.MixedHiddenFirst.field.0"]' 0 - // @has - '//*[@id="variant.MixedHiddenFirst.field.1"]' '1: S' + //@ has - '//*[@id="variant.MixedHiddenFirst"]//h3' 'MixedHiddenFirst(_, S)' + //@ count - '//*[@id="variant.MixedHiddenFirst.field.0"]' 0 + //@ has - '//*[@id="variant.MixedHiddenFirst.field.1"]' '1: S' MixedHiddenFirst(#[doc(hidden)] H, /** dox */ S), - // @has - '//*[@id="variant.MixedHiddenLast"]//h3' 'MixedHiddenLast(S, _)' - // @has - '//*[@id="variant.MixedHiddenLast.field.0"]' '0: S' - // @count - '//*[@id="variant.MixedHiddenLast.field.1"]' 0 + //@ has - '//*[@id="variant.MixedHiddenLast"]//h3' 'MixedHiddenLast(S, _)' + //@ has - '//*[@id="variant.MixedHiddenLast.field.0"]' '0: S' + //@ count - '//*[@id="variant.MixedHiddenLast.field.1"]' 0 MixedHiddenLast(/** dox */ S, #[doc(hidden)] H), - // @has - '//*[@id="variant.HiddenStruct"]//h3' 'HiddenStruct' - // @count - '//*[@id="variant.HiddenStruct.field.h"]' 0 - // @has - '//*[@id="variant.HiddenStruct.field.s"]' 's: S' + //@ has - '//*[@id="variant.HiddenStruct"]//h3' 'HiddenStruct' + //@ count - '//*[@id="variant.HiddenStruct.field.h"]' 0 + //@ has - '//*[@id="variant.HiddenStruct.field.s"]' 's: S' HiddenStruct { #[doc(hidden)] h: H, diff --git a/tests/rustdoc/enum-variant-fields-heading.rs b/tests/rustdoc/enum-variant-fields-heading.rs index 8a7c99a8735..e210667d3c0 100644 --- a/tests/rustdoc/enum-variant-fields-heading.rs +++ b/tests/rustdoc/enum-variant-fields-heading.rs @@ -3,12 +3,12 @@ #![crate_name = "foo"] -// @has 'foo/enum.Foo.html' -// @has - '//*[@id="variant.A"]' 'A' -// @count - '//*[@id="variant.A.fields"]' 0 -// @has - '//*[@id="variant.B"]' 'B' -// @count - '//*[@id="variant.B.fields"]' 0 -// @snapshot variants - '//*[@id="main-content"]/*[@class="variants"]' +//@ has 'foo/enum.Foo.html' +//@ has - '//*[@id="variant.A"]' 'A' +//@ count - '//*[@id="variant.A.fields"]' 0 +//@ has - '//*[@id="variant.B"]' 'B' +//@ count - '//*[@id="variant.B.fields"]' 0 +//@ snapshot variants - '//*[@id="main-content"]/*[@class="variants"]' pub enum Foo { /// A variant with no fields diff --git a/tests/rustdoc/enum-variant-private-46767.rs b/tests/rustdoc/enum-variant-private-46767.rs index 6386aa75a95..cc93684e723 100644 --- a/tests/rustdoc/enum-variant-private-46767.rs +++ b/tests/rustdoc/enum-variant-private-46767.rs @@ -6,5 +6,5 @@ mod private { } pub use self::private::Enum::*; -// @!has-dir foo/private -// @!has foo/index.html '//a/@href' 'private/index.html' +//@ !has-dir foo/private +//@ !has foo/index.html '//a/@href' 'private/index.html' diff --git a/tests/rustdoc/enum-variant-reexport-35488.rs b/tests/rustdoc/enum-variant-reexport-35488.rs index ed955dcd770..b8e42ef7a89 100644 --- a/tests/rustdoc/enum-variant-reexport-35488.rs +++ b/tests/rustdoc/enum-variant-reexport-35488.rs @@ -8,9 +8,9 @@ mod foo { pub use self::Foo::*; } -// @has 'foo/index.html' '//code' 'pub use self::Foo::*;' -// @has 'foo/enum.Foo.html' +//@ has 'foo/index.html' '//code' 'pub use self::Foo::*;' +//@ has 'foo/enum.Foo.html' pub use self::foo::*; -// @has 'foo/index.html' '//code' 'pub use std::option::Option::None;' +//@ has 'foo/index.html' '//code' 'pub use std::option::Option::None;' pub use std::option::Option::None; diff --git a/tests/rustdoc/enum-variant-value.rs b/tests/rustdoc/enum-variant-value.rs index 5767d9e5423..1670de8a24f 100644 --- a/tests/rustdoc/enum-variant-value.rs +++ b/tests/rustdoc/enum-variant-value.rs @@ -10,13 +10,13 @@ extern crate bar; // In this case, since all variants are C-like variants and at least one of them // has its value set, we display values for all of them. -// @has 'foo/enum.A.html' -// @has - '//*[@class="rust item-decl"]/code' 'A = 12,' -// @has - '//*[@class="rust item-decl"]/code' 'B = 13,' -// @has - '//*[@class="rust item-decl"]/code' 'C = 1_245,' -// @matches - '//*[@id="variant.A"]/h3' '^A = 12$' -// @matches - '//*[@id="variant.B"]/h3' '^B = 13$' -// @matches - '//*[@id="variant.C"]/h3' '^C = 1_245$' +//@ has 'foo/enum.A.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A = 12,' +//@ has - '//*[@class="rust item-decl"]/code' 'B = 13,' +//@ has - '//*[@class="rust item-decl"]/code' 'C = 1_245,' +//@ matches - '//*[@id="variant.A"]/h3' '^A = 12$' +//@ matches - '//*[@id="variant.B"]/h3' '^B = 13$' +//@ matches - '//*[@id="variant.C"]/h3' '^C = 1_245$' pub enum A { A = 12, B, @@ -26,11 +26,11 @@ pub enum A { // In this case, all variants are C-like variants but none of them has its value set. // Therefore we don't display values. -// @has 'foo/enum.B.html' -// @has - '//*[@class="rust item-decl"]/code' 'A,' -// @has - '//*[@class="rust item-decl"]/code' 'B,' -// @matches - '//*[@id="variant.A"]/h3' '^A$' -// @matches - '//*[@id="variant.B"]/h3' '^B$' +//@ has 'foo/enum.B.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A,' +//@ has - '//*[@class="rust item-decl"]/code' 'B,' +//@ matches - '//*[@id="variant.A"]/h3' '^A$' +//@ matches - '//*[@id="variant.B"]/h3' '^B$' pub enum B { A, B, @@ -38,13 +38,13 @@ pub enum B { // In this case, not all variants are C-like variants so we don't display values. -// @has 'foo/enum.C.html' -// @has - '//*[@class="rust item-decl"]/code' 'A = 12,' -// @has - '//*[@class="rust item-decl"]/code' 'B,' -// @has - '//*[@class="rust item-decl"]/code' 'C(u32),' -// @matches - '//*[@id="variant.A"]/h3' '^A = 12$' -// @matches - '//*[@id="variant.B"]/h3' '^B$' -// @has - '//*[@id="variant.C"]/h3' 'C(u32)' +//@ has 'foo/enum.C.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A = 12,' +//@ has - '//*[@class="rust item-decl"]/code' 'B,' +//@ has - '//*[@class="rust item-decl"]/code' 'C(u32),' +//@ matches - '//*[@id="variant.A"]/h3' '^A = 12$' +//@ matches - '//*[@id="variant.B"]/h3' '^B$' +//@ has - '//*[@id="variant.C"]/h3' 'C(u32)' #[repr(u32)] pub enum C { A = 12, @@ -55,59 +55,59 @@ pub enum C { // In this case, not all variants are C-like variants and no C-like variant has its // value set, so we don't display values. -// @has 'foo/enum.D.html' -// @has - '//*[@class="rust item-decl"]/code' 'A,' -// @has - '//*[@class="rust item-decl"]/code' 'C(u32),' -// @matches - '//*[@id="variant.A"]/h3' '^A$' -// @has - '//*[@id="variant.C"]/h3' 'C(u32)' +//@ has 'foo/enum.D.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A,' +//@ has - '//*[@class="rust item-decl"]/code' 'C(u32),' +//@ matches - '//*[@id="variant.A"]/h3' '^A$' +//@ has - '//*[@id="variant.C"]/h3' 'C(u32)' pub enum D { A, C(u32), } -// @has 'foo/enum.E.html' -// @has - '//*[@class="rust item-decl"]/code' 'A = 12,' -// @has - '//*[@class="rust item-decl"]/code' 'B = 13,' -// @has - '//*[@class="rust item-decl"]/code' 'C = 1_245,' -// @matches - '//*[@id="variant.A"]/h3' '^A = 12$' -// @matches - '//*[@id="variant.B"]/h3' '^B = 13$' -// @matches - '//*[@id="variant.C"]/h3' '^C = 1_245$' +//@ has 'foo/enum.E.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A = 12,' +//@ has - '//*[@class="rust item-decl"]/code' 'B = 13,' +//@ has - '//*[@class="rust item-decl"]/code' 'C = 1_245,' +//@ matches - '//*[@id="variant.A"]/h3' '^A = 12$' +//@ matches - '//*[@id="variant.B"]/h3' '^B = 13$' +//@ matches - '//*[@id="variant.C"]/h3' '^C = 1_245$' pub use bar::E; -// @has 'foo/enum.F.html' -// @has - '//*[@class="rust item-decl"]/code' 'A,' -// @has - '//*[@class="rust item-decl"]/code' 'B,' -// @matches - '//*[@id="variant.A"]/h3' '^A$' -// @matches - '//*[@id="variant.B"]/h3' '^B$' +//@ has 'foo/enum.F.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A,' +//@ has - '//*[@class="rust item-decl"]/code' 'B,' +//@ matches - '//*[@id="variant.A"]/h3' '^A$' +//@ matches - '//*[@id="variant.B"]/h3' '^B$' pub use bar::F; -// @has 'foo/enum.G.html' -// @has - '//*[@class="rust item-decl"]/code' 'A = 12,' -// @has - '//*[@class="rust item-decl"]/code' 'B,' -// @has - '//*[@class="rust item-decl"]/code' 'C(u32),' -// @matches - '//*[@id="variant.A"]/h3' '^A = 12$' -// @matches - '//*[@id="variant.B"]/h3' '^B$' -// @has - '//*[@id="variant.C"]/h3' 'C(u32)' +//@ has 'foo/enum.G.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A = 12,' +//@ has - '//*[@class="rust item-decl"]/code' 'B,' +//@ has - '//*[@class="rust item-decl"]/code' 'C(u32),' +//@ matches - '//*[@id="variant.A"]/h3' '^A = 12$' +//@ matches - '//*[@id="variant.B"]/h3' '^B$' +//@ has - '//*[@id="variant.C"]/h3' 'C(u32)' pub use bar::G; -// @has 'foo/enum.H.html' -// @has - '//*[@class="rust item-decl"]/code' 'A,' -// @has - '//*[@class="rust item-decl"]/code' 'C(u32),' -// @matches - '//*[@id="variant.A"]/h3' '^A$' -// @has - '//*[@id="variant.C"]/h3' 'C(u32)' +//@ has 'foo/enum.H.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A,' +//@ has - '//*[@class="rust item-decl"]/code' 'C(u32),' +//@ matches - '//*[@id="variant.A"]/h3' '^A$' +//@ has - '//*[@id="variant.C"]/h3' 'C(u32)' pub use bar::H; // Testing more complex cases. pub const X: isize = 2; -// @has 'foo/enum.I.html' -// @has - '//*[@class="rust item-decl"]/code' 'A = 2,' -// @has - '//*[@class="rust item-decl"]/code' 'B = 4,' -// @has - '//*[@class="rust item-decl"]/code' 'C = 9,' -// @has - '//*[@class="rust item-decl"]/code' 'D = -1,' -// @matches - '//*[@id="variant.A"]/h3' '^A = 2$' -// @matches - '//*[@id="variant.B"]/h3' '^B = 4$' -// @matches - '//*[@id="variant.C"]/h3' '^C = 9$' -// @matches - '//*[@id="variant.D"]/h3' '^D = -1$' +//@ has 'foo/enum.I.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A = 2,' +//@ has - '//*[@class="rust item-decl"]/code' 'B = 4,' +//@ has - '//*[@class="rust item-decl"]/code' 'C = 9,' +//@ has - '//*[@class="rust item-decl"]/code' 'D = -1,' +//@ matches - '//*[@id="variant.A"]/h3' '^A = 2$' +//@ matches - '//*[@id="variant.B"]/h3' '^B = 4$' +//@ matches - '//*[@id="variant.C"]/h3' '^C = 9$' +//@ matches - '//*[@id="variant.D"]/h3' '^D = -1$' #[repr(isize)] pub enum I { A = X, @@ -118,74 +118,74 @@ pub enum I { // Testing `repr`. -// @has 'foo/enum.J.html' -// @has - '//*[@class="rust item-decl"]/code' 'A = 0,' -// @has - '//*[@class="rust item-decl"]/code' 'B = 1,' -// @matches - '//*[@id="variant.A"]/h3' '^A = 0$' -// @matches - '//*[@id="variant.B"]/h3' '^B = 1$' +//@ has 'foo/enum.J.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A = 0,' +//@ has - '//*[@class="rust item-decl"]/code' 'B = 1,' +//@ matches - '//*[@id="variant.A"]/h3' '^A = 0$' +//@ matches - '//*[@id="variant.B"]/h3' '^B = 1$' #[repr(C)] pub enum J { A, B, } -// @has 'foo/enum.K.html' -// @has - '//*[@class="rust item-decl"]/code' 'A(u32),' -// @has - '//*[@class="rust item-decl"]/code' 'B,' -// @has - '//*[@id="variant.A"]/h3' 'A(u32)' -// @matches - '//*[@id="variant.B"]/h3' '^B$' +//@ has 'foo/enum.K.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A(u32),' +//@ has - '//*[@class="rust item-decl"]/code' 'B,' +//@ has - '//*[@id="variant.A"]/h3' 'A(u32)' +//@ matches - '//*[@id="variant.B"]/h3' '^B$' #[repr(C)] pub enum K { A(u32), B, } -// @has 'foo/enum.L.html' -// @has - '//*[@class="rust item-decl"]/code' 'A = 0,' -// @has - '//*[@class="rust item-decl"]/code' 'B = 1,' -// @matches - '//*[@id="variant.A"]/h3' '^A = 0$' -// @matches - '//*[@id="variant.B"]/h3' '^B = 1$' +//@ has 'foo/enum.L.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A = 0,' +//@ has - '//*[@class="rust item-decl"]/code' 'B = 1,' +//@ matches - '//*[@id="variant.A"]/h3' '^A = 0$' +//@ matches - '//*[@id="variant.B"]/h3' '^B = 1$' #[repr(u32)] pub enum L { A, B, } -// @has 'foo/enum.M.html' -// @has - '//*[@class="rust item-decl"]/code' 'A(u32),' -// @has - '//*[@class="rust item-decl"]/code' 'B,' -// @has - '//*[@id="variant.A"]/h3' 'A(u32)' -// @matches - '//*[@id="variant.B"]/h3' '^B$' +//@ has 'foo/enum.M.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A(u32),' +//@ has - '//*[@class="rust item-decl"]/code' 'B,' +//@ has - '//*[@id="variant.A"]/h3' 'A(u32)' +//@ matches - '//*[@id="variant.B"]/h3' '^B$' #[repr(u32)] pub enum M { A(u32), B, } -// @has 'foo/enum.N.html' -// @has - '//*[@class="rust item-decl"]/code' 'A = 0,' -// @has - '//*[@class="rust item-decl"]/code' 'B = 1,' -// @matches - '//*[@id="variant.A"]/h3' '^A = 0$' -// @matches - '//*[@id="variant.B"]/h3' '^B = 1$' +//@ has 'foo/enum.N.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A = 0,' +//@ has - '//*[@class="rust item-decl"]/code' 'B = 1,' +//@ matches - '//*[@id="variant.A"]/h3' '^A = 0$' +//@ matches - '//*[@id="variant.B"]/h3' '^B = 1$' pub use bar::N; -// @has 'foo/enum.O.html' -// @has - '//*[@class="rust item-decl"]/code' 'A(u32),' -// @has - '//*[@class="rust item-decl"]/code' 'B,' -// @has - '//*[@id="variant.A"]/h3' 'A(u32)' -// @matches - '//*[@id="variant.B"]/h3' '^B$' +//@ has 'foo/enum.O.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A(u32),' +//@ has - '//*[@class="rust item-decl"]/code' 'B,' +//@ has - '//*[@id="variant.A"]/h3' 'A(u32)' +//@ matches - '//*[@id="variant.B"]/h3' '^B$' pub use bar::O; -// @has 'foo/enum.P.html' -// @has - '//*[@class="rust item-decl"]/code' 'A = 0,' -// @has - '//*[@class="rust item-decl"]/code' 'B = 1,' -// @matches - '//*[@id="variant.A"]/h3' '^A = 0$' -// @matches - '//*[@id="variant.B"]/h3' '^B = 1$' +//@ has 'foo/enum.P.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A = 0,' +//@ has - '//*[@class="rust item-decl"]/code' 'B = 1,' +//@ matches - '//*[@id="variant.A"]/h3' '^A = 0$' +//@ matches - '//*[@id="variant.B"]/h3' '^B = 1$' pub use bar::P; -// @has 'foo/enum.Q.html' -// @has - '//*[@class="rust item-decl"]/code' 'A(u32),' -// @has - '//*[@class="rust item-decl"]/code' 'B,' -// @has - '//*[@id="variant.A"]/h3' 'A(u32)' -// @matches - '//*[@id="variant.B"]/h3' '^B$' +//@ has 'foo/enum.Q.html' +//@ has - '//*[@class="rust item-decl"]/code' 'A(u32),' +//@ has - '//*[@class="rust item-decl"]/code' 'B,' +//@ has - '//*[@id="variant.A"]/h3' 'A(u32)' +//@ matches - '//*[@id="variant.B"]/h3' '^B$' pub use bar::Q; diff --git a/tests/rustdoc/extern-default-method.rs b/tests/rustdoc/extern-default-method.rs index 058c2200d94..1af9fab152e 100644 --- a/tests/rustdoc/extern-default-method.rs +++ b/tests/rustdoc/extern-default-method.rs @@ -16,8 +16,8 @@ extern crate rustdoc_extern_default_method as ext; // general: If the type `Struct` also had an inherent method called `provided`, the impl item // would link to that one even though those two methods are distinct items! -// @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]' 1 -// @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="fn"]' 1 -// @snapshot no_href_on_anchor - '//*[@id="method.provided"]//a[@class="fn"]' -// @has extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="anchor"]/@href' #method.provided +//@ count extern_default_method/struct.Struct.html '//*[@id="method.provided"]' 1 +//@ count extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="fn"]' 1 +//@ snapshot no_href_on_anchor - '//*[@id="method.provided"]//a[@class="fn"]' +//@ has extern_default_method/struct.Struct.html '//*[@id="method.provided"]//a[@class="anchor"]/@href' #method.provided pub use ext::Struct; diff --git a/tests/rustdoc/extern-fn-22038.rs b/tests/rustdoc/extern-fn-22038.rs index 72d39c32a1c..206c6e181d1 100644 --- a/tests/rustdoc/extern-fn-22038.rs +++ b/tests/rustdoc/extern-fn-22038.rs @@ -2,21 +2,21 @@ #![crate_name="issue_22038"] extern "C" { - // @has issue_22038/fn.foo1.html \ + //@ has issue_22038/fn.foo1.html \ // '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn foo1()' pub fn foo1(); } extern "system" { - // @has issue_22038/fn.foo2.html \ + //@ has issue_22038/fn.foo2.html \ // '//pre[@class="rust item-decl"]' 'pub unsafe extern "system" fn foo2()' pub fn foo2(); } -// @has issue_22038/fn.bar.html \ +//@ has issue_22038/fn.bar.html \ // '//pre[@class="rust item-decl"]' 'pub extern "C" fn bar()' pub extern "C" fn bar() {} -// @has issue_22038/fn.baz.html \ +//@ has issue_22038/fn.baz.html \ // '//pre[@class="rust item-decl"]' 'pub extern "system" fn baz()' pub extern "system" fn baz() {} diff --git a/tests/rustdoc/extern-html-root-url-precedence.rs b/tests/rustdoc/extern-html-root-url-precedence.rs index 68af5ea5e04..93775087997 100644 --- a/tests/rustdoc/extern-html-root-url-precedence.rs +++ b/tests/rustdoc/extern-html-root-url-precedence.rs @@ -1,7 +1,7 @@ //@ compile-flags:-Z unstable-options --extern-html-root-url core=https://example.com/core/0.1.0 --extern-html-root-takes-precedence -// @has extern_html_root_url_precedence/index.html +//@ has extern_html_root_url_precedence/index.html // --extern-html-root should take precedence if `--takes-precedence` is passed -// @has - '//a/@href' 'https://example.com/core/0.1.0/core/iter/index.html' +//@ has - '//a/@href' 'https://example.com/core/0.1.0/core/iter/index.html' #[doc(no_inline)] pub use std::iter; diff --git a/tests/rustdoc/extern-html-root-url.rs b/tests/rustdoc/extern-html-root-url.rs index 672c460c20b..a503e829de4 100644 --- a/tests/rustdoc/extern-html-root-url.rs +++ b/tests/rustdoc/extern-html-root-url.rs @@ -6,13 +6,13 @@ extern crate html_root; extern crate no_html_root; -// @has extern_html_root_url/index.html +//@ has extern_html_root_url/index.html // `html_root_url` should override `--extern-html-root-url` -// @has - '//a/@href' 'https://example.com/html_root/html_root/fn.foo.html' +//@ has - '//a/@href' 'https://example.com/html_root/html_root/fn.foo.html' #[doc(no_inline)] pub use html_root::foo; #[doc(no_inline)] // `--extern-html-root-url` should apply if no `html_root_url` is given -// @has - '//a/@href' 'https://example.com/override/no_html_root/fn.bar.html' +//@ has - '//a/@href' 'https://example.com/override/no_html_root/fn.bar.html' pub use no_html_root::bar; diff --git a/tests/rustdoc/extern-impl-trait.rs b/tests/rustdoc/extern-impl-trait.rs index 9cc235504e7..65b7a8cef49 100644 --- a/tests/rustdoc/extern-impl-trait.rs +++ b/tests/rustdoc/extern-impl-trait.rs @@ -4,8 +4,8 @@ extern crate extern_impl_trait; -// @has 'foo/struct.X.html' '//h4[@class="code-header"]' "impl Foo + 'a" +//@ has 'foo/struct.X.html' '//h4[@class="code-header"]' "impl Foo + 'a" pub use extern_impl_trait::X; -// @has 'foo/struct.Y.html' '//h4[@class="code-header"]' "impl Foo + ?Sized + 'a" +//@ has 'foo/struct.Y.html' '//h4[@class="code-header"]' "impl Foo + ?Sized + 'a" pub use extern_impl_trait::Y; diff --git a/tests/rustdoc/extern-impl.rs b/tests/rustdoc/extern-impl.rs index fd1bc214008..4fc31393988 100644 --- a/tests/rustdoc/extern-impl.rs +++ b/tests/rustdoc/extern-impl.rs @@ -1,27 +1,27 @@ #![crate_name = "foo"] -// @has foo/struct.Foo.html +//@ has foo/struct.Foo.html pub struct Foo; impl Foo { - // @has - '//h4[@class="code-header"]' 'fn rust0()' + //@ has - '//h4[@class="code-header"]' 'fn rust0()' pub fn rust0() {} - // @has - '//h4[@class="code-header"]' 'fn rust1()' + //@ has - '//h4[@class="code-header"]' 'fn rust1()' pub extern "Rust" fn rust1() {} - // @has - '//h4[@class="code-header"]' 'extern "C" fn c0()' + //@ has - '//h4[@class="code-header"]' 'extern "C" fn c0()' pub extern fn c0() {} - // @has - '//h4[@class="code-header"]' 'extern "C" fn c1()' + //@ has - '//h4[@class="code-header"]' 'extern "C" fn c1()' pub extern "C" fn c1() {} - // @has - '//h4[@class="code-header"]' 'extern "system" fn system0()' + //@ has - '//h4[@class="code-header"]' 'extern "system" fn system0()' pub extern "system" fn system0() {} } -// @has foo/trait.Bar.html +//@ has foo/trait.Bar.html pub trait Bar {} -// @has - '//h3[@class="code-header"]' 'impl Bar for fn()' +//@ has - '//h3[@class="code-header"]' 'impl Bar for fn()' impl Bar for fn() {} -// @has - '//h3[@class="code-header"]' 'impl Bar for extern "C" fn()' +//@ has - '//h3[@class="code-header"]' 'impl Bar for extern "C" fn()' impl Bar for extern fn() {} -// @has - '//h3[@class="code-header"]' 'impl Bar for extern "system" fn()' +//@ has - '//h3[@class="code-header"]' 'impl Bar for extern "system" fn()' impl Bar for extern "system" fn() {} diff --git a/tests/rustdoc/extern-links.rs b/tests/rustdoc/extern-links.rs index a8c6eb76390..d1fee224755 100644 --- a/tests/rustdoc/extern-links.rs +++ b/tests/rustdoc/extern-links.rs @@ -5,17 +5,17 @@ pub extern crate extern_links; -// @!has foo/index.html '//a' 'extern_links' +//@ !has foo/index.html '//a' 'extern_links' #[doc(no_inline)] pub use extern_links as extern_links2; -// @!has foo/index.html '//a' 'Foo' +//@ !has foo/index.html '//a' 'Foo' #[doc(no_inline)] pub use extern_links::Foo; #[doc(hidden)] pub mod hidden { - // @!has foo/hidden/extern_links/index.html - // @!has foo/hidden/extern_links/struct.Foo.html + //@ !has foo/hidden/extern_links/index.html + //@ !has foo/hidden/extern_links/struct.Foo.html pub use extern_links; } diff --git a/tests/rustdoc/extern-method.rs b/tests/rustdoc/extern-method.rs index 3a86ad4feb0..c3e042f2da8 100644 --- a/tests/rustdoc/extern-method.rs +++ b/tests/rustdoc/extern-method.rs @@ -5,15 +5,15 @@ extern crate rustdoc_extern_method as foo; -// @has extern_method/trait.Foo.html //pre "pub trait Foo" -// @has - '//*[@id="tymethod.foo"]//h4[@class="code-header"]' 'extern "rust-call" fn foo' -// @has - '//*[@id="method.foo_"]//h4[@class="code-header"]' 'extern "rust-call" fn foo_' +//@ has extern_method/trait.Foo.html //pre "pub trait Foo" +//@ has - '//*[@id="tymethod.foo"]//h4[@class="code-header"]' 'extern "rust-call" fn foo' +//@ has - '//*[@id="method.foo_"]//h4[@class="code-header"]' 'extern "rust-call" fn foo_' pub use foo::Foo; -// @has extern_method/trait.Bar.html //pre "pub trait Bar" +//@ has extern_method/trait.Bar.html //pre "pub trait Bar" pub trait Bar { - // @has - '//*[@id="tymethod.bar"]//h4[@class="code-header"]' 'extern "rust-call" fn bar' + //@ has - '//*[@id="tymethod.bar"]//h4[@class="code-header"]' 'extern "rust-call" fn bar' extern "rust-call" fn bar(&self, _: ()); - // @has - '//*[@id="method.bar_"]//h4[@class="code-header"]' 'extern "rust-call" fn bar_' + //@ has - '//*[@id="method.bar_"]//h4[@class="code-header"]' 'extern "rust-call" fn bar_' extern "rust-call" fn bar_(&self, _: ()) { } } diff --git a/tests/rustdoc/external-cross.rs b/tests/rustdoc/external-cross.rs index 527c81839b5..13646ec38cf 100644 --- a/tests/rustdoc/external-cross.rs +++ b/tests/rustdoc/external-cross.rs @@ -5,6 +5,6 @@ extern crate external_cross; -// @has host/struct.NeedMoreDocs.html -// @has - '//h2' 'Cross-crate imported docs' +//@ has host/struct.NeedMoreDocs.html +//@ has - '//h2' 'Cross-crate imported docs' pub use external_cross::NeedMoreDocs; diff --git a/tests/rustdoc/external-doc.rs b/tests/rustdoc/external-doc.rs index bd322d67a37..c81aa17ed5a 100644 --- a/tests/rustdoc/external-doc.rs +++ b/tests/rustdoc/external-doc.rs @@ -1,14 +1,14 @@ -// @has external_doc/struct.IncludeStrDocs.html -// @has - '//h2' 'External Docs' -// @has - '//h3' 'Inline Docs' +//@ has external_doc/struct.IncludeStrDocs.html +//@ has - '//h2' 'External Docs' +//@ has - '//h3' 'Inline Docs' #[doc = include_str!("auxiliary/external-doc.md")] /// ## Inline Docs pub struct IncludeStrDocs; macro_rules! dir { () => { "auxiliary" } } -// @has external_doc/struct.EagerExpansion.html -// @has - '//h2' 'External Docs' +//@ has external_doc/struct.EagerExpansion.html +//@ has - '//h2' 'External Docs' #[doc = include_str!(concat!(dir!(), "/external-doc.md"))] /// ## Inline Docs pub struct EagerExpansion; diff --git a/tests/rustdoc/external-macro-src.rs b/tests/rustdoc/external-macro-src.rs index 1813ecb423f..f723af57fad 100644 --- a/tests/rustdoc/external-macro-src.rs +++ b/tests/rustdoc/external-macro-src.rs @@ -5,8 +5,8 @@ #[macro_use] extern crate external_macro_src; -// @has foo/index.html '//a[@href="../src/foo/external-macro-src.rs.html#3-12"]' 'source' +//@ has foo/index.html '//a[@href="../src/foo/external-macro-src.rs.html#3-12"]' 'source' -// @has foo/struct.Foo.html -// @has - '//a[@href="../src/foo/external-macro-src.rs.html#12"]' 'source' +//@ has foo/struct.Foo.html +//@ has - '//a[@href="../src/foo/external-macro-src.rs.html#12"]' 'source' make_foo!(); diff --git a/tests/rustdoc/feature-gate-doc_auto_cfg.rs b/tests/rustdoc/feature-gate-doc_auto_cfg.rs index da76381e480..75a488bc8ab 100644 --- a/tests/rustdoc/feature-gate-doc_auto_cfg.rs +++ b/tests/rustdoc/feature-gate-doc_auto_cfg.rs @@ -2,7 +2,7 @@ #![crate_name = "foo"] -// @has foo/fn.foo.html -// @count - '//*[@class="item-info"]/*[@class="stab portability"]' 0 +//@ has foo/fn.foo.html +//@ count - '//*[@class="item-info"]/*[@class="stab portability"]' 0 #[cfg(not(test))] pub fn foo() {} diff --git a/tests/rustdoc/ffi.rs b/tests/rustdoc/ffi.rs index c9dbdbf42a5..5ba7cdba910 100644 --- a/tests/rustdoc/ffi.rs +++ b/tests/rustdoc/ffi.rs @@ -3,10 +3,10 @@ extern crate rustdoc_ffi as lib; -// @has ffi/fn.foreigner.html //pre 'pub unsafe extern "C" fn foreigner(cold_as_ice: u32)' +//@ has ffi/fn.foreigner.html //pre 'pub unsafe extern "C" fn foreigner(cold_as_ice: u32)' pub use lib::foreigner; extern "C" { - // @has ffi/fn.another.html //pre 'pub unsafe extern "C" fn another(cold_as_ice: u32)' + //@ has ffi/fn.another.html //pre 'pub unsafe extern "C" fn another(cold_as_ice: u32)' pub fn another(cold_as_ice: u32); } diff --git a/tests/rustdoc/files-creation-hidden.rs b/tests/rustdoc/files-creation-hidden.rs index 498d9cdaef1..8adf84d6640 100644 --- a/tests/rustdoc/files-creation-hidden.rs +++ b/tests/rustdoc/files-creation-hidden.rs @@ -1,24 +1,24 @@ #![crate_name="foo"] -// @files foo '["index.html", "all.html", "sidebar-items.js"]' -// @!has "foo/struct.Foo.html" +//@ files foo '["index.html", "all.html", "sidebar-items.js"]' +//@ !has "foo/struct.Foo.html" #[doc(hidden)] pub struct Foo; -// @!has "foo/struct.Bar.html" +//@ !has "foo/struct.Bar.html" pub use crate::Foo as Bar; -// @!has "foo/struct.Baz.html" +//@ !has "foo/struct.Baz.html" #[doc(hidden)] pub use crate::Foo as Baz; -// @!has "foo/foo/index.html" +//@ !has "foo/foo/index.html" #[doc(hidden)] pub mod foo {} -// @!has "foo/bar/index.html" +//@ !has "foo/bar/index.html" pub use crate::foo as bar; -// @!has "foo/baz/index.html" +//@ !has "foo/baz/index.html" #[doc(hidden)] pub use crate::foo as baz; diff --git a/tests/rustdoc/files-creation-private.rs b/tests/rustdoc/files-creation-private.rs index e2fdbc068f8..54579380f0b 100644 --- a/tests/rustdoc/files-creation-private.rs +++ b/tests/rustdoc/files-creation-private.rs @@ -1,22 +1,22 @@ #![crate_name="foo"] -// @files "foo" \ +//@ files "foo" \ // '["index.html", "all.html", "sidebar-items.js", "foo", "bar", "private", "struct.Bar.html"]' -// @files "foo/bar" '["index.html", "sidebar-items.js"]' +//@ files "foo/bar" '["index.html", "sidebar-items.js"]' -// @!has "foo/priv/index.html" -// @!has "foo/priv/struct.Foo.html" +//@ !has "foo/priv/index.html" +//@ !has "foo/priv/struct.Foo.html" mod private { pub struct Foo; } -// @has "foo/struct.Bar.html" +//@ has "foo/struct.Bar.html" pub use crate::private::Foo as Bar; -// @!has "foo/foo/index.html" +//@ !has "foo/foo/index.html" mod foo { pub mod subfoo {} } -// @has "foo/bar/index.html" +//@ has "foo/bar/index.html" pub use crate::foo::subfoo as bar; diff --git a/tests/rustdoc/fn-bound.rs b/tests/rustdoc/fn-bound.rs index 9e060ff2026..460b6b14e79 100644 --- a/tests/rustdoc/fn-bound.rs +++ b/tests/rustdoc/fn-bound.rs @@ -11,7 +11,7 @@ pub struct ConditionalIterator { } -// @has 'fn_bound/struct.ConditionalIterator.html' '//h3[@class="code-header"]' 'impl Iterator for ConditionalIterator' +//@ has 'fn_bound/struct.ConditionalIterator.html' '//h3[@class="code-header"]' 'impl Iterator for ConditionalIterator' impl Iterator for ConditionalIterator { type Item = (); diff --git a/tests/rustdoc/fn-pointer-arg-name.rs b/tests/rustdoc/fn-pointer-arg-name.rs index 359ca64ee8d..3bde6e9ecfa 100644 --- a/tests/rustdoc/fn-pointer-arg-name.rs +++ b/tests/rustdoc/fn-pointer-arg-name.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -// @has foo/fn.f.html -// @has - '//pre[@class="rust item-decl"]' 'pub fn f(callback: fn(len: usize, foo: u32))' +//@ has foo/fn.f.html +//@ has - '//pre[@class="rust item-decl"]' 'pub fn f(callback: fn(len: usize, foo: u32))' pub fn f(callback: fn(len: usize, foo: u32)) {} diff --git a/tests/rustdoc/fn-sidebar.rs b/tests/rustdoc/fn-sidebar.rs index 2fe8ebec1c5..dfe756739a6 100644 --- a/tests/rustdoc/fn-sidebar.rs +++ b/tests/rustdoc/fn-sidebar.rs @@ -1,9 +1,9 @@ #![crate_name = "foo"] -// @has foo/fn.bar.html -// @has - '//*[@class="sidebar-elems"]' '' +//@ has foo/fn.bar.html +//@ has - '//*[@class="sidebar-elems"]' '' pub fn bar() {} -// @has foo/constant.BAR.html -// @has - '//*[@class="sidebar-elems"]' '' +//@ has foo/constant.BAR.html +//@ has - '//*[@class="sidebar-elems"]' '' pub const BAR: u32 = 0; diff --git a/tests/rustdoc/fn-type.rs b/tests/rustdoc/fn-type.rs index 3959aeb6cfb..6d63e5cea4a 100644 --- a/tests/rustdoc/fn-type.rs +++ b/tests/rustdoc/fn-type.rs @@ -8,6 +8,6 @@ pub struct Foo<'a, T> { pub hrtb_lifetime: for<'b, 'c> fn(one: &'b i32, two: &'c &'b i32) -> (&'b i32, &'c i32), } -// @has 'foo/struct.Foo.html' '//span[@id="structfield.generic"]' "generic: fn(val: &T) -> T" -// @has 'foo/struct.Foo.html' '//span[@id="structfield.lifetime"]' "lifetime: fn(val: &'a i32) -> i32" -// @has 'foo/struct.Foo.html' '//span[@id="structfield.hrtb_lifetime"]' "hrtb_lifetime: for<'b, 'c> fn(one: &'b i32, two: &'c &'b i32) -> (&'b i32, &'c i32)" +//@ has 'foo/struct.Foo.html' '//span[@id="structfield.generic"]' "generic: fn(val: &T) -> T" +//@ has 'foo/struct.Foo.html' '//span[@id="structfield.lifetime"]' "lifetime: fn(val: &'a i32) -> i32" +//@ has 'foo/struct.Foo.html' '//span[@id="structfield.hrtb_lifetime"]' "hrtb_lifetime: for<'b, 'c> fn(one: &'b i32, two: &'c &'b i32) -> (&'b i32, &'c i32)" diff --git a/tests/rustdoc/footnote-definition-without-blank-line-100638.rs b/tests/rustdoc/footnote-definition-without-blank-line-100638.rs index b6f62c3bcba..a8aab1ac38e 100644 --- a/tests/rustdoc/footnote-definition-without-blank-line-100638.rs +++ b/tests/rustdoc/footnote-definition-without-blank-line-100638.rs @@ -6,10 +6,10 @@ //! [^2]: Footnote B. //! [^3]: Footnote C. -// @has 'foo/index.html' -// @has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn1"]/p' 'Footnote A' -// @has - '//li[@id="fn1"]/p/a/@href' '#fnref1' -// @has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn2"]/p' 'Footnote B' -// @has - '//li[@id="fn2"]/p/a/@href' '#fnref2' -// @has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn3"]/p' 'Footnote C' -// @has - '//li[@id="fn3"]/p/a/@href' '#fnref3' +//@ has 'foo/index.html' +//@ has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn1"]/p' 'Footnote A' +//@ has - '//li[@id="fn1"]/p/a/@href' '#fnref1' +//@ has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn2"]/p' 'Footnote B' +//@ has - '//li[@id="fn2"]/p/a/@href' '#fnref2' +//@ has - '//*[@class="docblock"]/*[@class="footnotes"]/ol/li[@id="fn3"]/p' 'Footnote C' +//@ has - '//li[@id="fn3"]/p/a/@href' '#fnref3' diff --git a/tests/rustdoc/footnote-in-summary.rs b/tests/rustdoc/footnote-in-summary.rs index e6ff5a7fd51..d69282f1041 100644 --- a/tests/rustdoc/footnote-in-summary.rs +++ b/tests/rustdoc/footnote-in-summary.rs @@ -3,13 +3,13 @@ #![crate_name = "foo"] -// @has 'foo/index.html' -// @has - '//*[@class="desc docblock-short"]' 'hello bla' -// @!has - '//*[@class="desc docblock-short"]/sup' '1' +//@ has 'foo/index.html' +//@ has - '//*[@class="desc docblock-short"]' 'hello bla' +//@ !has - '//*[@class="desc docblock-short"]/sup' '1' -// @has 'foo/struct.S.html' -// @has - '//*[@class="docblock"]//sup' '1' -// @has - '//*[@class="docblock"]' 'hello 1 bla' +//@ has 'foo/struct.S.html' +//@ has - '//*[@class="docblock"]//sup' '1' +//@ has - '//*[@class="docblock"]' 'hello 1 bla' /// hello [^foot] bla /// diff --git a/tests/rustdoc/foreign-implementors-js-43701.rs b/tests/rustdoc/foreign-implementors-js-43701.rs index 3b16ad2045a..03147da02c2 100644 --- a/tests/rustdoc/foreign-implementors-js-43701.rs +++ b/tests/rustdoc/foreign-implementors-js-43701.rs @@ -3,4 +3,4 @@ pub use std::vec::Vec; -// @!has trait.impl/core/clone/trait.Clone.js +//@ !has trait.impl/core/clone/trait.Clone.js diff --git a/tests/rustdoc/foreigntype-reexport.rs b/tests/rustdoc/foreigntype-reexport.rs index 1dec0ef3e0f..22c1852adf5 100644 --- a/tests/rustdoc/foreigntype-reexport.rs +++ b/tests/rustdoc/foreigntype-reexport.rs @@ -11,11 +11,11 @@ mod sub { pub mod sub2 { extern "C" { - // @has foreigntype_reexport/sub2/foreigntype.C.html + //@ has foreigntype_reexport/sub2/foreigntype.C.html pub type C; - // @has foreigntype_reexport/sub2/fn.f.html + //@ has foreigntype_reexport/sub2/fn.f.html pub fn f(); - // @has foreigntype_reexport/sub2/static.K3.html + //@ has foreigntype_reexport/sub2/static.K3.html pub static K3: usize; } } @@ -29,28 +29,28 @@ mod sub3 { } } -// @has foreigntype_reexport/foreigntype.C2.html -// @has foreigntype_reexport/fn.f2.html -// @has foreigntype_reexport/static.K2.html -// @has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'C2' -// @has foreigntype_reexport/index.html '//a[@class="fn"]' 'f2' -// @has foreigntype_reexport/index.html '//a[@class="static"]' 'K2' +//@ has foreigntype_reexport/foreigntype.C2.html +//@ has foreigntype_reexport/fn.f2.html +//@ has foreigntype_reexport/static.K2.html +//@ has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'C2' +//@ has foreigntype_reexport/index.html '//a[@class="fn"]' 'f2' +//@ has foreigntype_reexport/index.html '//a[@class="static"]' 'K2' pub use self::sub::{f2, C2, K as K2}; -// @has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'C' -// @has foreigntype_reexport/index.html '//a[@class="fn"]' 'f' -// @has foreigntype_reexport/index.html '//a[@class="static"]' 'K3' -// @has foreigntype_reexport/index.html '//code' 'pub use self::sub2::C as C3;' -// @has foreigntype_reexport/index.html '//code' 'pub use self::sub2::f as f3;' -// @has foreigntype_reexport/index.html '//code' 'pub use self::sub2::K3;' +//@ has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'C' +//@ has foreigntype_reexport/index.html '//a[@class="fn"]' 'f' +//@ has foreigntype_reexport/index.html '//a[@class="static"]' 'K3' +//@ has foreigntype_reexport/index.html '//code' 'pub use self::sub2::C as C3;' +//@ has foreigntype_reexport/index.html '//code' 'pub use self::sub2::f as f3;' +//@ has foreigntype_reexport/index.html '//code' 'pub use self::sub2::K3;' pub use self::sub2::{f as f3, C as C3, K3}; -// @has foreigntype_reexport/foreigntype.C4.html -// @has foreigntype_reexport/fn.f4.html -// @has foreigntype_reexport/static.K4.html -// @!has foreigntype_reexport/foreigntype.X4.html -// @has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'C4' -// @has foreigntype_reexport/index.html '//a[@class="fn"]' 'f4' -// @has foreigntype_reexport/index.html '//a[@class="static"]' 'K4' -// @!has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'X4' +//@ has foreigntype_reexport/foreigntype.C4.html +//@ has foreigntype_reexport/fn.f4.html +//@ has foreigntype_reexport/static.K4.html +//@ !has foreigntype_reexport/foreigntype.X4.html +//@ has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'C4' +//@ has foreigntype_reexport/index.html '//a[@class="fn"]' 'f4' +//@ has foreigntype_reexport/index.html '//a[@class="static"]' 'K4' +//@ !has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'X4' pub use self::sub3::*; diff --git a/tests/rustdoc/foreigntype.rs b/tests/rustdoc/foreigntype.rs index 29f9c2926e9..bee3d8e6509 100644 --- a/tests/rustdoc/foreigntype.rs +++ b/tests/rustdoc/foreigntype.rs @@ -1,18 +1,18 @@ #![feature(extern_types)] extern "C" { - // @has foreigntype/foreigntype.ExtType.html + //@ has foreigntype/foreigntype.ExtType.html pub type ExtType; } impl ExtType { - // @has - '//a[@class="fn"]' 'do_something' + //@ has - '//a[@class="fn"]' 'do_something' pub fn do_something(&self) {} } pub trait Trait {} -// @has foreigntype/trait.Trait.html '//a[@class="foreigntype"]' 'ExtType' +//@ has foreigntype/trait.Trait.html '//a[@class="foreigntype"]' 'ExtType' impl Trait for ExtType {} -// @has foreigntype/index.html '//a[@class="foreigntype"]' 'ExtType' +//@ has foreigntype/index.html '//a[@class="foreigntype"]' 'ExtType' diff --git a/tests/rustdoc/generic-associated-types/gats.rs b/tests/rustdoc/generic-associated-types/gats.rs index 605176e5fea..ecfa1796e72 100644 --- a/tests/rustdoc/generic-associated-types/gats.rs +++ b/tests/rustdoc/generic-associated-types/gats.rs @@ -1,19 +1,19 @@ #![crate_name = "foo"] -// @has foo/trait.LendingIterator.html +//@ has foo/trait.LendingIterator.html pub trait LendingIterator { - // @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item<'a> where Self: 'a" + //@ has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item<'a> where Self: 'a" type Item<'a> where Self: 'a; - // @has - '//*[@id="tymethod.next"]//h4[@class="code-header"]' \ + //@ has - '//*[@id="tymethod.next"]//h4[@class="code-header"]' \ // "fn next<'a>(&'a self) -> Self::Item<'a>" - // @has - '//*[@id="tymethod.next"]//h4[@class="code-header"]//a[@href="trait.LendingIterator.html#associatedtype.Item"]' \ + //@ has - '//*[@id="tymethod.next"]//h4[@class="code-header"]//a[@href="trait.LendingIterator.html#associatedtype.Item"]' \ // "Item" fn next<'a>(&'a self) -> Self::Item<'a>; } -// @has foo/trait.LendingIterator.html -// @has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' "type Item<'a> = ()" +//@ has foo/trait.LendingIterator.html +//@ has - '//*[@id="associatedtype.Item-1"]//h4[@class="code-header"]' "type Item<'a> = ()" impl LendingIterator for () { type Item<'a> = (); @@ -22,8 +22,8 @@ impl LendingIterator for () { pub struct Infinite(T); -// @has foo/trait.LendingIterator.html -// @has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item<'a> = &'a T where Self: 'a" +//@ has foo/trait.LendingIterator.html +//@ has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item<'a> = &'a T where Self: 'a" impl LendingIterator for Infinite { type Item<'a> = &'a T where Self: 'a; diff --git a/tests/rustdoc/generic-associated-types/issue-109488.rs b/tests/rustdoc/generic-associated-types/issue-109488.rs index 99ae8a6c36c..12f8988f520 100644 --- a/tests/rustdoc/generic-associated-types/issue-109488.rs +++ b/tests/rustdoc/generic-associated-types/issue-109488.rs @@ -2,9 +2,9 @@ // the href of the corresponding trait (in this case it is private). // Further, test that we also linkify the GAT arguments. -// @has 'issue_109488/type.A.html' -// @has - '//pre[@class="rust item-decl"]' '::P>' -// @has - '//pre[@class="rust item-decl"]//a[@class="enum"]/@href' '{{channel}}/core/option/enum.Option.html' +//@ has 'issue_109488/type.A.html' +//@ has - '//pre[@class="rust item-decl"]' '::P>' +//@ has - '//pre[@class="rust item-decl"]//a[@class="enum"]/@href' '{{channel}}/core/option/enum.Option.html' pub type A = ::P>; /*private*/ trait Tr { diff --git a/tests/rustdoc/generic-associated-types/issue-94683.rs b/tests/rustdoc/generic-associated-types/issue-94683.rs index 985c7e983aa..19a1e9d448e 100644 --- a/tests/rustdoc/generic-associated-types/issue-94683.rs +++ b/tests/rustdoc/generic-associated-types/issue-94683.rs @@ -6,7 +6,7 @@ pub trait Trait { // Make sure that the elided lifetime shows up -// @has foo/type.T.html -// @hasraw - "pub type T = " -// @hasraw - "<'_>" +//@ has foo/type.T.html +//@ hasraw - "pub type T = " +//@ hasraw - "<'_>" pub type T = fn(&<() as Trait>::Gat<'_>); diff --git a/tests/rustdoc/generic-const-items.rs b/tests/rustdoc/generic-const-items.rs index e2c6a027afa..31c300f2ff1 100644 --- a/tests/rustdoc/generic-const-items.rs +++ b/tests/rustdoc/generic-const-items.rs @@ -1,8 +1,8 @@ #![feature(generic_const_items)] #![allow(incomplete_features)] -// @has 'generic_const_items/constant.K.html' -// @has - '//*[@class="rust item-decl"]//code' \ +//@ has 'generic_const_items/constant.K.html' +//@ has - '//*[@class="rust item-decl"]//code' \ // "pub const K<'a, T: 'a + Copy, const N: usize>: Option<[T; N]> \ // where \ // String: From;" @@ -10,9 +10,9 @@ pub const K<'a, T: 'a + Copy, const N: usize>: Option<[T; N]> = None where String: From; -// @has generic_const_items/trait.Trait.html +//@ has generic_const_items/trait.Trait.html pub trait Trait { - // @has - '//*[@id="associatedconstant.C"]' \ + //@ has - '//*[@id="associatedconstant.C"]' \ // "const C<'a>: &'a T \ // where \ // T: 'a + Eq" @@ -23,10 +23,10 @@ pub trait Trait { pub struct Implementor; -// @has generic_const_items/struct.Implementor.html -// @has - '//h3[@class="code-header"]' 'impl Trait for Implementor' +//@ has generic_const_items/struct.Implementor.html +//@ has - '//h3[@class="code-header"]' 'impl Trait for Implementor' impl Trait for Implementor { - // @has - '//*[@id="associatedconstant.C"]' \ + //@ has - '//*[@id="associatedconstant.C"]' \ // "const C<'a>: &'a str = \"C\" \ // where \ // str: 'a" diff --git a/tests/rustdoc/generic-impl.rs b/tests/rustdoc/generic-impl.rs index f62540c6bf9..9d15d0fff77 100644 --- a/tests/rustdoc/generic-impl.rs +++ b/tests/rustdoc/generic-impl.rs @@ -2,12 +2,12 @@ use std::fmt; -// @!has foo/struct.Bar.html '//*[@id="impl-ToString-for-Bar"]' '' +//@ !has foo/struct.Bar.html '//*[@id="impl-ToString-for-Bar"]' '' pub struct Bar; -// @has foo/struct.Foo.html '//*[@id="impl-ToString-for-T"]//h3[@class="code-header"]' 'impl ToString for T' +//@ has foo/struct.Foo.html '//*[@id="impl-ToString-for-T"]//h3[@class="code-header"]' 'impl ToString for T' pub struct Foo; -// @has foo/struct.Foo.html '//*[@class="sidebar-elems"]//section//a[@href="#impl-ToString-for-T"]' 'ToString' +//@ has foo/struct.Foo.html '//*[@class="sidebar-elems"]//section//a[@href="#impl-ToString-for-T"]' 'ToString' impl fmt::Display for Foo { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/tests/rustdoc/generic_const_exprs.rs b/tests/rustdoc/generic_const_exprs.rs index 6ff59163975..44f7bf5b24c 100644 --- a/tests/rustdoc/generic_const_exprs.rs +++ b/tests/rustdoc/generic_const_exprs.rs @@ -5,7 +5,7 @@ #![crate_name = "foo"] -// @has 'foo/trait.Foo.html' +//@ has 'foo/trait.Foo.html' pub trait Foo: Sized { const WIDTH: usize; @@ -16,7 +16,7 @@ pub trait Foo: Sized { impl Foo for T { const WIDTH: usize = 1; - // @has - '//*[@id="tymethod.arrayify"]/*[@class="code-header"]' \ + //@ has - '//*[@id="tymethod.arrayify"]/*[@class="code-header"]' \ // 'fn arrayify(self) -> [Self; Self::WIDTH]' fn arrayify(self) -> [Self; Self::WIDTH] { [self] diff --git a/tests/rustdoc/glob-reexport-attribute-merge-120487.rs b/tests/rustdoc/glob-reexport-attribute-merge-120487.rs index 98cdec107ae..2fa10f546d5 100644 --- a/tests/rustdoc/glob-reexport-attribute-merge-120487.rs +++ b/tests/rustdoc/glob-reexport-attribute-merge-120487.rs @@ -5,11 +5,11 @@ #![crate_name = "foo"] #![feature(doc_cfg)] -// @has 'foo/index.html' +//@ has 'foo/index.html' // There are two items. -// @count - '//*[@class="item-table"]//div[@class="item-name"]' 2 +//@ count - '//*[@class="item-table"]//div[@class="item-name"]' 2 // Only one of them should have an attribute. -// @count - '//*[@class="item-table"]//div[@class="item-name"]/*[@class="stab portability"]' 1 +//@ count - '//*[@class="item-table"]//div[@class="item-name"]/*[@class="stab portability"]' 1 mod a { #[doc(cfg(not(feature = "a")))] @@ -23,10 +23,10 @@ mod b { pub struct Test2; } -// @has 'foo/struct.Test1.html' -// @count - '//*[@id="main-content"]/*[@class="item-info"]' 1 -// @has - '//*[@id="main-content"]/*[@class="item-info"]' 'Available on non-crate feature a only.' +//@ has 'foo/struct.Test1.html' +//@ count - '//*[@id="main-content"]/*[@class="item-info"]' 1 +//@ has - '//*[@id="main-content"]/*[@class="item-info"]' 'Available on non-crate feature a only.' pub use a::*; -// @has 'foo/struct.Test2.html' -// @count - '//*[@id="main-content"]/*[@class="item-info"]' 0 +//@ has 'foo/struct.Test2.html' +//@ count - '//*[@id="main-content"]/*[@class="item-info"]' 0 pub use b::Test2; diff --git a/tests/rustdoc/glob-reexport-attribute-merge-doc-auto-cfg.rs b/tests/rustdoc/glob-reexport-attribute-merge-doc-auto-cfg.rs index 3e3e602eb1b..314b457c2ad 100644 --- a/tests/rustdoc/glob-reexport-attribute-merge-doc-auto-cfg.rs +++ b/tests/rustdoc/glob-reexport-attribute-merge-doc-auto-cfg.rs @@ -4,11 +4,11 @@ #![crate_name = "foo"] #![feature(doc_auto_cfg)] -// @has 'foo/index.html' +//@ has 'foo/index.html' // There are two items. -// @count - '//*[@class="item-table"]//div[@class="item-name"]' 2 +//@ count - '//*[@class="item-table"]//div[@class="item-name"]' 2 // Only one of them should have an attribute. -// @count - '//*[@class="item-table"]//div[@class="item-name"]/*[@class="stab portability"]' 1 +//@ count - '//*[@class="item-table"]//div[@class="item-name"]/*[@class="stab portability"]' 1 mod a { #[cfg(not(feature = "a"))] @@ -20,10 +20,10 @@ mod b { pub struct Test2; } -// @has 'foo/struct.Test1.html' -// @count - '//*[@id="main-content"]/*[@class="item-info"]' 1 -// @has - '//*[@id="main-content"]/*[@class="item-info"]' 'Available on non-crate feature a only.' +//@ has 'foo/struct.Test1.html' +//@ count - '//*[@id="main-content"]/*[@class="item-info"]' 1 +//@ has - '//*[@id="main-content"]/*[@class="item-info"]' 'Available on non-crate feature a only.' pub use a::*; -// @has 'foo/struct.Test2.html' -// @count - '//*[@id="main-content"]/*[@class="item-info"]' 0 +//@ has 'foo/struct.Test2.html' +//@ count - '//*[@id="main-content"]/*[@class="item-info"]' 0 pub use b::Test2; diff --git a/tests/rustdoc/glob-shadowing-const.rs b/tests/rustdoc/glob-shadowing-const.rs index 58fe8173e03..1eb5596cd9c 100644 --- a/tests/rustdoc/glob-shadowing-const.rs +++ b/tests/rustdoc/glob-shadowing-const.rs @@ -14,7 +14,7 @@ mod sub4 { #[doc(inline)] pub use sub4::inner::*; -// @has 'foo/index.html' -// @has - '//div[@class="desc docblock-short"]' '1' -// @!has - '//div[@class="desc docblock-short"]' '0' +//@ has 'foo/index.html' +//@ has - '//div[@class="desc docblock-short"]' '1' +//@ !has - '//div[@class="desc docblock-short"]' '0' fn main() { assert_eq!(X, 1); } diff --git a/tests/rustdoc/glob-shadowing.rs b/tests/rustdoc/glob-shadowing.rs index c117b9d6489..a051bd407d5 100644 --- a/tests/rustdoc/glob-shadowing.rs +++ b/tests/rustdoc/glob-shadowing.rs @@ -1,20 +1,20 @@ -// @has 'glob_shadowing/index.html' -// @count - '//div[@class="item-name"]' 6 -// @!has - '//div[@class="desc docblock-short"]' 'sub1::describe' -// @has - '//div[@class="desc docblock-short"]' 'sub2::describe' +//@ has 'glob_shadowing/index.html' +//@ count - '//div[@class="item-name"]' 6 +//@ !has - '//div[@class="desc docblock-short"]' 'sub1::describe' +//@ has - '//div[@class="desc docblock-short"]' 'sub2::describe' -// @!has - '//div[@class="desc docblock-short"]' 'sub1::describe2' +//@ !has - '//div[@class="desc docblock-short"]' 'sub1::describe2' -// @!has - '//div[@class="desc docblock-short"]' 'sub1::prelude' -// @has - '//div[@class="desc docblock-short"]' 'mod::prelude' +//@ !has - '//div[@class="desc docblock-short"]' 'sub1::prelude' +//@ has - '//div[@class="desc docblock-short"]' 'mod::prelude' -// @has - '//div[@class="desc docblock-short"]' 'sub1::Foo (struct)' -// @has - '//div[@class="desc docblock-short"]' 'mod::Foo (function)' +//@ has - '//div[@class="desc docblock-short"]' 'sub1::Foo (struct)' +//@ has - '//div[@class="desc docblock-short"]' 'mod::Foo (function)' -// @has - '//div[@class="desc docblock-short"]' 'sub4::inner::X' +//@ has - '//div[@class="desc docblock-short"]' 'sub4::inner::X' -// @has 'glob_shadowing/fn.describe.html' -// @has - '//div[@class="docblock"]' 'sub2::describe' +//@ has 'glob_shadowing/fn.describe.html' +//@ has - '//div[@class="docblock"]' 'sub2::describe' mod sub1 { // this should be shadowed by sub2::describe diff --git a/tests/rustdoc/heading-levels-89309.rs b/tests/rustdoc/heading-levels-89309.rs index caa99428525..772217c1594 100644 --- a/tests/rustdoc/heading-levels-89309.rs +++ b/tests/rustdoc/heading-levels-89309.rs @@ -1,20 +1,20 @@ // https://github.com/rust-lang/rust/issues/89309 #![crate_name = "foo"] -// @has foo/trait.Read.html -// @has - '//h2' 'Trait examples' +//@ has foo/trait.Read.html +//@ has - '//h2' 'Trait examples' /// # Trait examples pub trait Read { - // @has - '//h5' 'Function examples' + //@ has - '//h5' 'Function examples' /// # Function examples fn read(&mut self, buf: &mut [u8]) -> Result; } pub struct Foo; -// @has foo/struct.Foo.html +//@ has foo/struct.Foo.html impl Foo { - // @has - '//h5' 'Implementation header' + //@ has - '//h5' 'Implementation header' /// # Implementation header pub fn bar(&self) -> usize { 1 @@ -22,7 +22,7 @@ impl Foo { } impl Read for Foo { - // @has - '//h5' 'Trait implementation header' + //@ has - '//h5' 'Trait implementation header' /// # Trait implementation header fn read(&mut self, buf: &mut [u8]) -> Result { Ok(1) diff --git a/tests/rustdoc/hidden-extern-34025.rs b/tests/rustdoc/hidden-extern-34025.rs index 81ccf2a0e5c..2a7b21a874d 100644 --- a/tests/rustdoc/hidden-extern-34025.rs +++ b/tests/rustdoc/hidden-extern-34025.rs @@ -1,12 +1,12 @@ // https://github.com/rust-lang/rust/issues/34025 #![crate_name = "foo"] -// @!has 'foo/sys/index.html' -// @!has 'foo/sys/sidebar-items.js' +//@ !has 'foo/sys/index.html' +//@ !has 'foo/sys/sidebar-items.js' #[doc(hidden)] pub mod sys { extern "C" { - // @!has 'foo/sys/fn.foo.html' + //@ !has 'foo/sys/fn.foo.html' #[doc(hidden)] pub fn foo(); } diff --git a/tests/rustdoc/hidden-impls.rs b/tests/rustdoc/hidden-impls.rs index 3283fbfecce..73deeed9e90 100644 --- a/tests/rustdoc/hidden-impls.rs +++ b/tests/rustdoc/hidden-impls.rs @@ -10,8 +10,8 @@ pub mod __hidden { pub use hidden::Foo; } -// @has foo/trait.Clone.html -// @!hasraw - 'Foo' -// @has trait.impl/core/clone/trait.Clone.js -// @!hasraw - 'Foo' +//@ has foo/trait.Clone.html +//@ !hasraw - 'Foo' +//@ has trait.impl/core/clone/trait.Clone.js +//@ !hasraw - 'Foo' pub use std::clone::Clone; diff --git a/tests/rustdoc/hidden-line.rs b/tests/rustdoc/hidden-line.rs index 00a05a7c26f..0162b27d8be 100644 --- a/tests/rustdoc/hidden-line.rs +++ b/tests/rustdoc/hidden-line.rs @@ -15,5 +15,5 @@ /// ``` pub fn foo() {} -// @!hasraw hidden_line/fn.foo.html invisible -// @matches - //pre "#\[derive\(PartialEq\)\] // Bar" +//@ !hasraw hidden_line/fn.foo.html invisible +//@ matches - //pre "#\[derive\(PartialEq\)\] // Bar" diff --git a/tests/rustdoc/hidden-methods.rs b/tests/rustdoc/hidden-methods.rs index 543d8f768a6..ed9c1ee1aac 100644 --- a/tests/rustdoc/hidden-methods.rs +++ b/tests/rustdoc/hidden-methods.rs @@ -16,14 +16,14 @@ pub mod hidden { } } -// @has foo/struct.Foo.html -// @!hasraw - 'Methods' -// @!has - '//code' 'impl Foo' -// @!hasraw - 'this_should_be_hidden' +//@ has foo/struct.Foo.html +//@ !hasraw - 'Methods' +//@ !has - '//code' 'impl Foo' +//@ !hasraw - 'this_should_be_hidden' pub use hidden::Foo; -// @has foo/struct.Bar.html -// @!hasraw - 'Methods' -// @!has - '//code' 'impl Bar' -// @!hasraw - 'this_should_be_hidden' +//@ has foo/struct.Bar.html +//@ !hasraw - 'Methods' +//@ !has - '//code' 'impl Bar' +//@ !hasraw - 'this_should_be_hidden' pub use hidden::Bar; diff --git a/tests/rustdoc/hidden-private.rs b/tests/rustdoc/hidden-private.rs index 5e3c7f3a3e4..658e093cc23 100644 --- a/tests/rustdoc/hidden-private.rs +++ b/tests/rustdoc/hidden-private.rs @@ -6,10 +6,10 @@ #![crate_name = "foo"] -// @has 'foo/index.html' -// @count - '//*[@class="item-table"]//a[@class="struct"]' 2 -// @count - '//*[@class="item-table"]//a[@class="trait"]' 1 -// @count - '//*[@class="item-table"]//a[@class="macro"]' 0 +//@ has 'foo/index.html' +//@ count - '//*[@class="item-table"]//a[@class="struct"]' 2 +//@ count - '//*[@class="item-table"]//a[@class="trait"]' 1 +//@ count - '//*[@class="item-table"]//a[@class="macro"]' 0 #[doc(hidden)] const _: () = { macro_rules! stry { @@ -18,8 +18,8 @@ const _: () = { struct ShouldBeHidden; - // @has 'foo/struct.Foo.html' - // @!has - '//*[@class="code-header"]' 'impl Bar for Foo' + //@ has 'foo/struct.Foo.html' + //@ !has - '//*[@class="code-header"]' 'impl Bar for Foo' #[doc(hidden)] impl Bar for Foo { fn bar(&self) { @@ -27,15 +27,15 @@ const _: () = { } } - // @has 'foo/struct.Private.html' - // @has - '//*[@id="impl-Bar-for-Private"]/*[@class="code-header"]' 'impl Bar for Private' - // @has - '//*[@id="method.bar"]/*[@class="code-header"]' 'fn bar(&self)' + //@ has 'foo/struct.Private.html' + //@ has - '//*[@id="impl-Bar-for-Private"]/*[@class="code-header"]' 'impl Bar for Private' + //@ has - '//*[@id="method.bar"]/*[@class="code-header"]' 'fn bar(&self)' impl Bar for Private { fn bar(&self) {} } - // @has - '//*[@id="impl-Private"]/*[@class="code-header"]' 'impl Private' - // @has - '//*[@id="method.tralala"]/*[@class="code-header"]' 'fn tralala()' + //@ has - '//*[@id="impl-Private"]/*[@class="code-header"]' 'impl Private' + //@ has - '//*[@id="method.tralala"]/*[@class="code-header"]' 'fn tralala()' impl Private { fn tralala() {} } diff --git a/tests/rustdoc/hidden-trait-methods-with-document-hidden-items.rs b/tests/rustdoc/hidden-trait-methods-with-document-hidden-items.rs index d2269e3b021..a290992e5fe 100644 --- a/tests/rustdoc/hidden-trait-methods-with-document-hidden-items.rs +++ b/tests/rustdoc/hidden-trait-methods-with-document-hidden-items.rs @@ -3,11 +3,11 @@ // test for trait methods with `doc(hidden)` with `--document-hidden-items` passed. #![crate_name = "foo"] -// @has foo/trait.Trait.html -// @has - '//*[@id="associatedtype.Foo"]' 'type Foo' -// @has - '//*[@id="associatedtype.Bar"]' 'type Bar' -// @has - '//*[@id="tymethod.f"]' 'fn f()' -// @has - '//*[@id="tymethod.g"]' 'fn g()' +//@ has foo/trait.Trait.html +//@ has - '//*[@id="associatedtype.Foo"]' 'type Foo' +//@ has - '//*[@id="associatedtype.Bar"]' 'type Bar' +//@ has - '//*[@id="tymethod.f"]' 'fn f()' +//@ has - '//*[@id="tymethod.g"]' 'fn g()' pub trait Trait { #[doc(hidden)] type Foo; @@ -17,11 +17,11 @@ pub trait Trait { fn g(); } -// @has foo/struct.S.html -// @has - '//*[@id="associatedtype.Foo"]' 'type Foo' -// @has - '//*[@id="associatedtype.Bar"]' 'type Bar' -// @has - '//*[@id="method.f"]' 'fn f()' -// @has - '//*[@id="method.g"]' 'fn g()' +//@ has foo/struct.S.html +//@ has - '//*[@id="associatedtype.Foo"]' 'type Foo' +//@ has - '//*[@id="associatedtype.Bar"]' 'type Bar' +//@ has - '//*[@id="method.f"]' 'fn f()' +//@ has - '//*[@id="method.g"]' 'fn g()' pub struct S; impl Trait for S { type Foo = (); diff --git a/tests/rustdoc/hidden-trait-methods.rs b/tests/rustdoc/hidden-trait-methods.rs index e924ba7d0ac..2c342ff28b3 100644 --- a/tests/rustdoc/hidden-trait-methods.rs +++ b/tests/rustdoc/hidden-trait-methods.rs @@ -1,11 +1,11 @@ // test for trait methods with `doc(hidden)`. #![crate_name = "foo"] -// @has foo/trait.Trait.html -// @!has - '//*[@id="associatedtype.Foo"]' 'type Foo' -// @has - '//*[@id="associatedtype.Bar"]' 'type Bar' -// @!has - '//*[@id="tymethod.f"]' 'fn f()' -// @has - '//*[@id="tymethod.g"]' 'fn g()' +//@ has foo/trait.Trait.html +//@ !has - '//*[@id="associatedtype.Foo"]' 'type Foo' +//@ has - '//*[@id="associatedtype.Bar"]' 'type Bar' +//@ !has - '//*[@id="tymethod.f"]' 'fn f()' +//@ has - '//*[@id="tymethod.g"]' 'fn g()' pub trait Trait { #[doc(hidden)] type Foo; @@ -15,11 +15,11 @@ pub trait Trait { fn g(); } -// @has foo/struct.S.html -// @!has - '//*[@id="associatedtype.Foo"]' 'type Foo' -// @has - '//*[@id="associatedtype.Bar"]' 'type Bar' -// @!has - '//*[@id="method.f"]' 'fn f()' -// @has - '//*[@id="method.g"]' 'fn g()' +//@ has foo/struct.S.html +//@ !has - '//*[@id="associatedtype.Foo"]' 'type Foo' +//@ has - '//*[@id="associatedtype.Bar"]' 'type Bar' +//@ !has - '//*[@id="method.f"]' 'fn f()' +//@ has - '//*[@id="method.g"]' 'fn g()' pub struct S; impl Trait for S { type Foo = (); diff --git a/tests/rustdoc/hidden-trait-struct-impls.rs b/tests/rustdoc/hidden-trait-struct-impls.rs index cc3f6337719..1010cb45960 100644 --- a/tests/rustdoc/hidden-trait-struct-impls.rs +++ b/tests/rustdoc/hidden-trait-struct-impls.rs @@ -11,12 +11,12 @@ pub struct Bar; struct Hidden; -// @!has foo/struct.Bar.html '//*[@id="impl-Foo-for-Bar"]' 'impl Foo for Bar' +//@ !has foo/struct.Bar.html '//*[@id="impl-Foo-for-Bar"]' 'impl Foo for Bar' impl Foo for Bar {} -// @!has foo/struct.Bar.html '//*[@id="impl-Dark-for-Bar"]' 'impl Dark for Bar' +//@ !has foo/struct.Bar.html '//*[@id="impl-Dark-for-Bar"]' 'impl Dark for Bar' impl Dark for Bar {} -// @has foo/struct.Bar.html '//*[@id="impl-Bam-for-Bar"]' 'impl Bam for Bar' -// @has foo/trait.Bam.html '//*[@id="implementors-list"]' 'impl Bam for Bar' +//@ has foo/struct.Bar.html '//*[@id="impl-Bam-for-Bar"]' 'impl Bam for Bar' +//@ has foo/trait.Bam.html '//*[@id="implementors-list"]' 'impl Bam for Bar' impl Bam for Bar {} -// @!has foo/trait.Bam.html '//*[@id="implementors-list"]' 'impl Bam for Hidden' +//@ !has foo/trait.Bam.html '//*[@id="implementors-list"]' 'impl Bam for Hidden' impl Bam for Hidden {} diff --git a/tests/rustdoc/hide-complex-unevaluated-const-arguments.rs b/tests/rustdoc/hide-complex-unevaluated-const-arguments.rs index d728f772a69..e94c1ea5c61 100644 --- a/tests/rustdoc/hide-complex-unevaluated-const-arguments.rs +++ b/tests/rustdoc/hide-complex-unevaluated-const-arguments.rs @@ -9,7 +9,7 @@ use std::marker::ConstParamTy; -// @has hide_complex_unevaluated_const_arguments/trait.Stage.html +//@ has hide_complex_unevaluated_const_arguments/trait.Stage.html pub trait Stage { // A helper constant that prevents const expressions containing it // from getting fully evaluated since it doesn't have a body and @@ -29,12 +29,12 @@ pub trait Stage { // This assoc. const could leak the private assoc. function `Struct::new`. // Ensure that this does not happen. // - // @has - '//*[@id="associatedconstant.ARRAY1"]' \ + //@ has - '//*[@id="associatedconstant.ARRAY1"]' \ // 'const ARRAY1: [u8; { _ }]' const ARRAY1: [u8; Struct::new(/* ... */).do_something(Self::ABSTRACT * 1_000)] where [(); Struct::new(/* ... */).do_something(Self::ABSTRACT * 1_000)]:; - // @has - '//*[@id="associatedconstant.VERBOSE"]' \ + //@ has - '//*[@id="associatedconstant.VERBOSE"]' \ // 'const VERBOSE: [u16; { _ }]' const VERBOSE: [u16; compute("thing", 9 + 9) * Self::ABSTRACT] where [(); compute("thing", 9 + 9) * Self::ABSTRACT]:; @@ -44,7 +44,7 @@ pub trait Stage { // (e.g. printing sth. akin to `>::OUT`) but // right now “safe is safe”. // - // @has - '//*[@id="associatedconstant.PATH"]' \ + //@ has - '//*[@id="associatedconstant.PATH"]' \ // 'const PATH: usize = _' const PATH: usize = >::OUT; } @@ -66,7 +66,7 @@ impl Helper for St { // If rustdoc gets patched to evaluate const arguments, it is fine to replace // this test as long as one can ensure that private fields are not leaked! // -// @has hide_complex_unevaluated_const_arguments/trait.Sub.html \ +//@ has hide_complex_unevaluated_const_arguments/trait.Sub.html \ // '//pre[@class="rust item-decl"]' \ // 'pub trait Sub: Sup<{ _ }, { _ }> { }' pub trait Sub: Sup<{ 90 * 20 * 4 }, { Struct { private: () } }> {} diff --git a/tests/rustdoc/hide-complex-unevaluated-consts.rs b/tests/rustdoc/hide-complex-unevaluated-consts.rs index ba623246a01..61ae8c801dd 100644 --- a/tests/rustdoc/hide-complex-unevaluated-consts.rs +++ b/tests/rustdoc/hide-complex-unevaluated-consts.rs @@ -7,7 +7,7 @@ // Read the documentation of `rustdoc::clean::utils::print_const_expr` // for further details. -// @has hide_complex_unevaluated_consts/trait.Container.html +//@ has hide_complex_unevaluated_consts/trait.Container.html pub trait Container { // A helper constant that prevents const expressions containing it // from getting fully evaluated since it doesn't have a body and @@ -17,11 +17,11 @@ pub trait Container { // Ensure that the private field does not get leaked: // - // @has - '//*[@id="associatedconstant.STRUCT0"]' \ + //@ has - '//*[@id="associatedconstant.STRUCT0"]' \ // 'const STRUCT0: Struct = _' const STRUCT0: Struct = Struct { private: () }; - // @has - '//*[@id="associatedconstant.STRUCT1"]' \ + //@ has - '//*[@id="associatedconstant.STRUCT1"]' \ // 'const STRUCT1: (Struct,) = _' const STRUCT1: (Struct,) = (Struct{private: /**/()},); @@ -30,20 +30,20 @@ pub trait Container { // show it. However for the time being, the printing logic is a bit // conservative. // - // @has - '//*[@id="associatedconstant.STRUCT2"]' \ + //@ has - '//*[@id="associatedconstant.STRUCT2"]' \ // 'const STRUCT2: Record = _' const STRUCT2: Record = Record { public: 5 }; // Test that we do not show the incredibly verbose match expr: // - // @has - '//*[@id="associatedconstant.MATCH0"]' \ + //@ has - '//*[@id="associatedconstant.MATCH0"]' \ // 'const MATCH0: i32 = _' const MATCH0: i32 = match 234 { 0 => 1, _ => Self::ABSTRACT, }; - // @has - '//*[@id="associatedconstant.MATCH1"]' \ + //@ has - '//*[@id="associatedconstant.MATCH1"]' \ // 'const MATCH1: bool = _' const MATCH1: bool = match Self::ABSTRACT { _ => true, @@ -61,7 +61,7 @@ pub trait Container { // For now, the implementation is quite simple and the choices // rather conservative. // - // @has - '//*[@id="associatedconstant.ARITH_OPS"]' \ + //@ has - '//*[@id="associatedconstant.ARITH_OPS"]' \ // 'const ARITH_OPS: i32 = _' const ARITH_OPS: i32 = Self::ABSTRACT * 2 + 1; } diff --git a/tests/rustdoc/hide-mut-methods-if-no-derefmut-impl-74083.rs b/tests/rustdoc/hide-mut-methods-if-no-derefmut-impl-74083.rs index 0bed7e2fb62..995121a8455 100644 --- a/tests/rustdoc/hide-mut-methods-if-no-derefmut-impl-74083.rs +++ b/tests/rustdoc/hide-mut-methods-if-no-derefmut-impl-74083.rs @@ -9,8 +9,8 @@ impl Foo { pub fn foo(&mut self) {} } -// @has foo/struct.Bar.html -// @!has - '//div[@class="sidebar-links"]/a[@href="#method.foo"]' 'foo' +//@ has foo/struct.Bar.html +//@ !has - '//div[@class="sidebar-links"]/a[@href="#method.foo"]' 'foo' pub struct Bar { foo: Foo, } diff --git a/tests/rustdoc/hide-unstable-trait.rs b/tests/rustdoc/hide-unstable-trait.rs index ebf9efb368b..33c514c77a7 100644 --- a/tests/rustdoc/hide-unstable-trait.rs +++ b/tests/rustdoc/hide-unstable-trait.rs @@ -5,7 +5,7 @@ extern crate unstable_trait; -// @hasraw foo/struct.Foo.html 'bar' -// @hasraw foo/struct.Foo.html 'bar2' +//@ hasraw foo/struct.Foo.html 'bar' +//@ hasraw foo/struct.Foo.html 'bar2' #[doc(inline)] pub use unstable_trait::Foo; diff --git a/tests/rustdoc/higher-ranked-trait-bounds.rs b/tests/rustdoc/higher-ranked-trait-bounds.rs index 3493ae6d2bb..cda2ddc9166 100644 --- a/tests/rustdoc/higher-ranked-trait-bounds.rs +++ b/tests/rustdoc/higher-ranked-trait-bounds.rs @@ -1,44 +1,44 @@ #![crate_name = "foo"] -// @has foo/trait.Trait.html +//@ has foo/trait.Trait.html pub trait Trait<'x> {} -// @has foo/fn.test1.html -// @has - '//pre' "pub fn test1()where for<'a> &'a T: Iterator," +//@ has foo/fn.test1.html +//@ has - '//pre' "pub fn test1()where for<'a> &'a T: Iterator," pub fn test1() where for<'a> &'a T: Iterator, { } -// @has foo/fn.test2.html -// @has - '//pre' "pub fn test2()where for<'a, 'b> &'a T: Trait<'b>," +//@ has foo/fn.test2.html +//@ has - '//pre' "pub fn test2()where for<'a, 'b> &'a T: Trait<'b>," pub fn test2() where for<'a, 'b> &'a T: Trait<'b>, { } -// @has foo/fn.test3.html -// @has - '//pre' "pub fn test3()where F: for<'a, 'b> Fn(&'a u8, &'b u8)," +//@ has foo/fn.test3.html +//@ has - '//pre' "pub fn test3()where F: for<'a, 'b> Fn(&'a u8, &'b u8)," pub fn test3() where F: for<'a, 'b> Fn(&'a u8, &'b u8), { } -// @has foo/struct.Foo.html +//@ has foo/struct.Foo.html pub struct Foo<'a> { _x: &'a u8, pub some_trait: &'a dyn for<'b> Trait<'b>, pub some_func: for<'c> fn(val: &'c i32) -> i32, } -// @has - '//span[@id="structfield.some_func"]' "some_func: for<'c> fn(val: &'c i32) -> i32" -// @has - '//span[@id="structfield.some_trait"]' "some_trait: &'a dyn for<'b> Trait<'b>" +//@ has - '//span[@id="structfield.some_func"]' "some_func: for<'c> fn(val: &'c i32) -> i32" +//@ has - '//span[@id="structfield.some_trait"]' "some_trait: &'a dyn for<'b> Trait<'b>" impl<'a> Foo<'a> { - // @has - '//h4[@class="code-header"]' "pub fn bar()where T: Trait<'a>," + //@ has - '//h4[@class="code-header"]' "pub fn bar()where T: Trait<'a>," pub fn bar() where T: Trait<'a>, @@ -46,15 +46,15 @@ impl<'a> Foo<'a> { } } -// @has foo/trait.B.html +//@ has foo/trait.B.html pub trait B<'x> {} -// @has - '//h3[@class="code-header"]' "impl<'a> B<'a> for dyn for<'b> Trait<'b>" +//@ has - '//h3[@class="code-header"]' "impl<'a> B<'a> for dyn for<'b> Trait<'b>" impl<'a> B<'a> for dyn for<'b> Trait<'b> {} -// @has foo/struct.Bar.html -// @has - '//span[@id="structfield.bar"]' "bar: &'a (dyn for<'b> Trait<'b> + Unpin)" -// @has - '//span[@id="structfield.baz"]' "baz: &'a (dyn Unpin + for<'b> Trait<'b>)" +//@ has foo/struct.Bar.html +//@ has - '//span[@id="structfield.bar"]' "bar: &'a (dyn for<'b> Trait<'b> + Unpin)" +//@ has - '//span[@id="structfield.baz"]' "baz: &'a (dyn Unpin + for<'b> Trait<'b>)" pub struct Bar<'a> { pub bar: &'a (dyn for<'b> Trait<'b> + Unpin), pub baz: &'a (dyn Unpin + for<'b> Trait<'b>), diff --git a/tests/rustdoc/highlight-invalid-rust-12834.rs b/tests/rustdoc/highlight-invalid-rust-12834.rs index f8acc500264..f4a015ded29 100644 --- a/tests/rustdoc/highlight-invalid-rust-12834.rs +++ b/tests/rustdoc/highlight-invalid-rust-12834.rs @@ -5,8 +5,8 @@ #![crate_name="issue_12834"] #![allow(rustdoc::invalid_rust_codeblocks)] -// @has issue_12834/fn.foo.html -// @has - //pre 'a + b ' +//@ has issue_12834/fn.foo.html +//@ has - //pre 'a + b ' /// ``` /// a + b ∈ Self ∀ a, b ∈ Self diff --git a/tests/rustdoc/html-no-source.rs b/tests/rustdoc/html-no-source.rs index b52792837e5..100ab0031f7 100644 --- a/tests/rustdoc/html-no-source.rs +++ b/tests/rustdoc/html-no-source.rs @@ -8,23 +8,23 @@ #![crate_name = "foo"] // Ensures that there is no items in the corresponding "src" folder. -// @files 'src/foo' '[]' +//@ files 'src/foo' '[]' -// @has foo/fn.foo.html -// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · ' -// @!has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' +//@ has foo/fn.foo.html +//@ has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · ' +//@ !has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' #[stable(feature = "bar", since = "1.0")] pub fn foo() {} -// @has foo/struct.Bar.html -// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · ' -// @!has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' +//@ has foo/struct.Bar.html +//@ has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · ' +//@ !has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' #[stable(feature = "bar", since = "1.0")] pub struct Bar; impl Bar { - // @has - '//*[@id="method.bar"]/*[@class="since rightside"]' '2.0.0' - // @!has - '//*[@id="method.bar"]/*[@class="rightside"]' '2.0.0 ·' + //@ has - '//*[@id="method.bar"]/*[@class="since rightside"]' '2.0.0' + //@ !has - '//*[@id="method.bar"]/*[@class="rightside"]' '2.0.0 ·' #[stable(feature = "foobar", since = "2.0")] pub fn bar() {} } diff --git a/tests/rustdoc/impl-alias-substituted.rs b/tests/rustdoc/impl-alias-substituted.rs index 82dfffe5f1c..02efcd88df8 100644 --- a/tests/rustdoc/impl-alias-substituted.rs +++ b/tests/rustdoc/impl-alias-substituted.rs @@ -2,7 +2,7 @@ pub struct Matrix([[T; N]; M]); pub type Vector = Matrix; -// @has "impl_alias_substituted/struct.Matrix.html" '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has "impl_alias_substituted/struct.Matrix.html" '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Matrix" impl Vector { pub fn test() {} diff --git a/tests/rustdoc/impl-assoc-type-21092.rs b/tests/rustdoc/impl-assoc-type-21092.rs index 2354fb986e7..c350456195d 100644 --- a/tests/rustdoc/impl-assoc-type-21092.rs +++ b/tests/rustdoc/impl-assoc-type-21092.rs @@ -6,6 +6,6 @@ extern crate issue_21092; -// @has issue_21092/struct.Bar.html -// @has - '//*[@id="associatedtype.Bar"]' 'type Bar = i32' +//@ has issue_21092/struct.Bar.html +//@ has - '//*[@id="associatedtype.Bar"]' 'type Bar = i32' pub use issue_21092::{Foo, Bar}; diff --git a/tests/rustdoc/impl-blanket-53689.rs b/tests/rustdoc/impl-blanket-53689.rs index 63bce550b9b..4b1697349f2 100644 --- a/tests/rustdoc/impl-blanket-53689.rs +++ b/tests/rustdoc/impl-blanket-53689.rs @@ -5,9 +5,9 @@ extern crate issue_53689; -// @has foo/trait.MyTrait.html -// @!hasraw - 'MyStruct' -// @count - '//*[h3="impl MyTrait for T"]' 1 +//@ has foo/trait.MyTrait.html +//@ !hasraw - 'MyStruct' +//@ count - '//*[h3="impl MyTrait for T"]' 1 pub trait MyTrait {} impl MyTrait for T {} diff --git a/tests/rustdoc/impl-box.rs b/tests/rustdoc/impl-box.rs index 592b6c98587..1fb63e21685 100644 --- a/tests/rustdoc/impl-box.rs +++ b/tests/rustdoc/impl-box.rs @@ -4,8 +4,8 @@ pub struct MyType; -// @has 'impl_box/struct.MyType.html' -// @has '-' '//*[@id="impl-Iterator-for-Box%3CMyType%3E"]' 'impl Iterator for Box' +//@ has 'impl_box/struct.MyType.html' +//@ has '-' '//*[@id="impl-Iterator-for-Box%3CMyType%3E"]' 'impl Iterator for Box' impl Iterator for Box { type Item = (); diff --git a/tests/rustdoc/impl-disambiguation.rs b/tests/rustdoc/impl-disambiguation.rs index 9e74ede8ff7..cfd5013964b 100644 --- a/tests/rustdoc/impl-disambiguation.rs +++ b/tests/rustdoc/impl-disambiguation.rs @@ -4,13 +4,13 @@ pub trait Foo {} pub struct Bar { field: T } -// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ +//@ has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ // "impl Foo for Bar" impl Foo for Bar {} -// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ +//@ has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ // "impl Foo for Bar" impl Foo for Bar {} -// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ +//@ has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ // "impl<'a> Foo for &'a Bar" impl<'a> Foo for &'a Bar {} @@ -22,9 +22,9 @@ pub mod mod2 { pub enum Baz {} } -// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ +//@ has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ // "impl Foo for foo::mod1::Baz" impl Foo for mod1::Baz {} -// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ +//@ has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ // "impl<'a> Foo for &'a foo::mod2::Baz" impl<'a> Foo for &'a mod2::Baz {} diff --git a/tests/rustdoc/impl-everywhere.rs b/tests/rustdoc/impl-everywhere.rs index 2311c806c18..d1a4e901bad 100644 --- a/tests/rustdoc/impl-everywhere.rs +++ b/tests/rustdoc/impl-everywhere.rs @@ -8,23 +8,23 @@ pub struct Bar; impl Foo for Bar {} impl Foo2 for Bar {} -// @has foo/fn.foo.html '//section[@id="main-content"]//pre' "x: &'x impl Foo" -// @has foo/fn.foo.html '//section[@id="main-content"]//pre' "-> &'x impl Foo" +//@ has foo/fn.foo.html '//section[@id="main-content"]//pre' "x: &'x impl Foo" +//@ has foo/fn.foo.html '//section[@id="main-content"]//pre' "-> &'x impl Foo" pub fn foo<'x>(x: &'x impl Foo) -> &'x impl Foo { x } -// @has foo/fn.foo2.html '//section[@id="main-content"]//pre' "x: &'x impl Foo" -// @has foo/fn.foo2.html '//section[@id="main-content"]//pre' '-> impl Foo2' +//@ has foo/fn.foo2.html '//section[@id="main-content"]//pre' "x: &'x impl Foo" +//@ has foo/fn.foo2.html '//section[@id="main-content"]//pre' '-> impl Foo2' pub fn foo2<'x>(_x: &'x impl Foo) -> impl Foo2 { Bar } -// @has foo/fn.foo_foo.html '//section[@id="main-content"]//pre' '-> impl Foo + Foo2' +//@ has foo/fn.foo_foo.html '//section[@id="main-content"]//pre' '-> impl Foo + Foo2' pub fn foo_foo() -> impl Foo + Foo2 { Bar } -// @has foo/fn.foo_foo_foo.html '//section[@id="main-content"]//pre' "x: &'x (impl Foo + Foo2)" +//@ has foo/fn.foo_foo_foo.html '//section[@id="main-content"]//pre' "x: &'x (impl Foo + Foo2)" pub fn foo_foo_foo<'x>(_x: &'x (impl Foo + Foo2)) { } diff --git a/tests/rustdoc/impl-in-const-block.rs b/tests/rustdoc/impl-in-const-block.rs index b44e7135246..3f757fa9566 100644 --- a/tests/rustdoc/impl-in-const-block.rs +++ b/tests/rustdoc/impl-in-const-block.rs @@ -4,12 +4,12 @@ #![crate_name = "foo"] -// @has 'foo/struct.A.html' -// @has - '//*[@id="method.new"]/*[@class="code-header"]' 'pub fn new() -> A' -// @has - '//*[@id="method.bar"]/*[@class="code-header"]' 'pub fn bar(&self)' -// @has - '//*[@id="method.woo"]/*[@class="code-header"]' 'pub fn woo(&self)' -// @has - '//*[@id="method.yoo"]/*[@class="code-header"]' 'pub fn yoo()' -// @has - '//*[@id="method.yuu"]/*[@class="code-header"]' 'pub fn yuu()' +//@ has 'foo/struct.A.html' +//@ has - '//*[@id="method.new"]/*[@class="code-header"]' 'pub fn new() -> A' +//@ has - '//*[@id="method.bar"]/*[@class="code-header"]' 'pub fn bar(&self)' +//@ has - '//*[@id="method.woo"]/*[@class="code-header"]' 'pub fn woo(&self)' +//@ has - '//*[@id="method.yoo"]/*[@class="code-header"]' 'pub fn yoo()' +//@ has - '//*[@id="method.yuu"]/*[@class="code-header"]' 'pub fn yuu()' pub struct A; const _: () = { diff --git a/tests/rustdoc/impl-on-ty-alias-issue-119015.rs b/tests/rustdoc/impl-on-ty-alias-issue-119015.rs index 68996deae6f..cea0f5565a2 100644 --- a/tests/rustdoc/impl-on-ty-alias-issue-119015.rs +++ b/tests/rustdoc/impl-on-ty-alias-issue-119015.rs @@ -1,9 +1,9 @@ #![crate_name = "foo"] -// @has 'foo/index.html' +//@ has 'foo/index.html' // There should be only `type A`. -// @count - '//*[@class="item-table"]//*[@class="item-name"]' 1 -// @has - '//*[@class="item-name"]/a[@href="type.A.html"]' 'A' +//@ count - '//*[@class="item-table"]//*[@class="item-name"]' 1 +//@ has - '//*[@class="item-name"]/a[@href="type.A.html"]' 'A' mod foo { pub struct S; @@ -13,15 +13,15 @@ use foo::S; pub type A = S; -// @has 'foo/type.A.html' -// @has - '//*[@id="method.default"]/h4' 'fn default() -> Self' +//@ has 'foo/type.A.html' +//@ has - '//*[@id="method.default"]/h4' 'fn default() -> Self' impl Default for A { fn default() -> Self { S } } -// @has - '//*[@id="method.a"]/h4' 'pub fn a(&self)' +//@ has - '//*[@id="method.a"]/h4' 'pub fn a(&self)' impl A { pub fn a(&self) {} } diff --git a/tests/rustdoc/impl-parts-crosscrate.rs b/tests/rustdoc/impl-parts-crosscrate.rs index 2cca3a5c37c..49752ab75d5 100644 --- a/tests/rustdoc/impl-parts-crosscrate.rs +++ b/tests/rustdoc/impl-parts-crosscrate.rs @@ -12,9 +12,9 @@ pub struct Bar { t: T } // full impl string. Instead, just make sure something from each part // is mentioned. -// @hasraw trait.impl/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar -// @hasraw - Send -// @hasraw - !AnAutoTrait -// @hasraw - Copy +//@ hasraw trait.impl/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar +//@ hasraw - Send +//@ hasraw - !AnAutoTrait +//@ hasraw - Copy impl !rustdoc_impl_parts_crosscrate::AnAutoTrait for Bar where T: Copy {} diff --git a/tests/rustdoc/impl-parts.rs b/tests/rustdoc/impl-parts.rs index f7738060e99..820f51008a4 100644 --- a/tests/rustdoc/impl-parts.rs +++ b/tests/rustdoc/impl-parts.rs @@ -5,8 +5,8 @@ pub auto trait AnAutoTrait {} pub struct Foo { field: T } -// @has impl_parts/struct.Foo.html '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has impl_parts/struct.Foo.html '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl !AnAutoTrait for Foowhere T: Sync + Clone," -// @has impl_parts/trait.AnAutoTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ +//@ has impl_parts/trait.AnAutoTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ // "impl !AnAutoTrait for Foowhere T: Sync + Clone," impl !AnAutoTrait for Foo where T: Sync {} diff --git a/tests/rustdoc/impl-ref-20175.rs b/tests/rustdoc/impl-ref-20175.rs index a92db2d0a66..b1a9286fd41 100644 --- a/tests/rustdoc/impl-ref-20175.rs +++ b/tests/rustdoc/impl-ref-20175.rs @@ -8,7 +8,7 @@ pub trait Foo { pub struct Bar; -// @has issue_20175/struct.Bar.html \ +//@ has issue_20175/struct.Bar.html \ // '//*[@id="method.foo"]' \ // 'fn foo' impl<'a> Foo for &'a Bar {} diff --git a/tests/rustdoc/impl-trait-43869.rs b/tests/rustdoc/impl-trait-43869.rs index 9c4ed841f79..89176f59ca1 100644 --- a/tests/rustdoc/impl-trait-43869.rs +++ b/tests/rustdoc/impl-trait-43869.rs @@ -61,15 +61,15 @@ pub fn test_44731_4() -> Box> { Box::new(g()) } -// @has foo/fn.g.html -// @has foo/fn.h.html -// @has foo/fn.i.html -// @has foo/fn.j.html -// @has foo/fn.k.html -// @has foo/fn.l.html -// @has foo/fn.m.html -// @has foo/fn.n.html -// @has foo/fn.o.html -// @has foo/fn.test_44731_0.html -// @has foo/fn.test_44731_1.html -// @has foo/fn.test_44731_4.html +//@ has foo/fn.g.html +//@ has foo/fn.h.html +//@ has foo/fn.i.html +//@ has foo/fn.j.html +//@ has foo/fn.k.html +//@ has foo/fn.l.html +//@ has foo/fn.m.html +//@ has foo/fn.n.html +//@ has foo/fn.o.html +//@ has foo/fn.test_44731_0.html +//@ has foo/fn.test_44731_1.html +//@ has foo/fn.test_44731_4.html diff --git a/tests/rustdoc/impl-trait-alias.rs b/tests/rustdoc/impl-trait-alias.rs index 4f681c78ee1..f7ecfffbf46 100644 --- a/tests/rustdoc/impl-trait-alias.rs +++ b/tests/rustdoc/impl-trait-alias.rs @@ -3,11 +3,11 @@ trait MyTrait {} impl MyTrait for i32 {} -// @hasraw impl_trait_alias/type.Foo.html 'Foo' +//@ hasraw impl_trait_alias/type.Foo.html 'Foo' /// debug type pub type Foo = impl MyTrait; -// @hasraw impl_trait_alias/fn.foo.html 'foo' +//@ hasraw impl_trait_alias/fn.foo.html 'foo' /// debug function pub fn foo() -> Foo { 1 diff --git a/tests/rustdoc/impl-type-parameter-33592.rs b/tests/rustdoc/impl-type-parameter-33592.rs index 77f53710e5e..ac5df460925 100644 --- a/tests/rustdoc/impl-type-parameter-33592.rs +++ b/tests/rustdoc/impl-type-parameter-33592.rs @@ -7,8 +7,8 @@ pub struct Bar; pub struct Baz; -// @has foo/trait.Foo.html '//h3[@class="code-header"]' 'impl Foo for Bar' +//@ has foo/trait.Foo.html '//h3[@class="code-header"]' 'impl Foo for Bar' impl Foo for Bar {} -// @has foo/trait.Foo.html '//h3[@class="code-header"]' 'impl Foo for Baz' +//@ has foo/trait.Foo.html '//h3[@class="code-header"]' 'impl Foo for Baz' impl Foo for Baz {} diff --git a/tests/rustdoc/implementor-stable-version.rs b/tests/rustdoc/implementor-stable-version.rs index 3674b9f2e48..cd4fa93f803 100644 --- a/tests/rustdoc/implementor-stable-version.rs +++ b/tests/rustdoc/implementor-stable-version.rs @@ -12,10 +12,10 @@ pub trait Baz {} #[stable(feature = "baz", since = "3.3.3")] pub struct Foo; -// @has foo/trait.Bar.html '//div[@id="implementors-list"]//span[@class="since"]' '4.4.4' +//@ has foo/trait.Bar.html '//div[@id="implementors-list"]//span[@class="since"]' '4.4.4' #[stable(feature = "foobar", since = "4.4.4")] impl Bar for Foo {} -// @has foo/trait.Baz.html '//div[@id="implementors-list"]//span[@class="since"]' '3.3.3' +//@ has foo/trait.Baz.html '//div[@id="implementors-list"]//span[@class="since"]' '3.3.3' #[stable(feature = "foobaz", since = "3.3.3")] impl Baz for Foo {} diff --git a/tests/rustdoc/implementors-unstable-75588.rs b/tests/rustdoc/implementors-unstable-75588.rs index befddf6b788..44a785c4ad9 100644 --- a/tests/rustdoc/implementors-unstable-75588.rs +++ b/tests/rustdoc/implementors-unstable-75588.rs @@ -11,8 +11,8 @@ extern crate realcore; extern crate real_gimli; // issue #74672 -// @!has foo/trait.Deref.html '//*[@id="impl-Deref-for-EndianSlice"]//h3[@class="code-header"]' 'impl Deref for EndianSlice' +//@ !has foo/trait.Deref.html '//*[@id="impl-Deref-for-EndianSlice"]//h3[@class="code-header"]' 'impl Deref for EndianSlice' pub use realcore::Deref; -// @has foo/trait.Join.html '//*[@id="impl-Join-for-Foo"]//h3[@class="code-header"]' 'impl Join for Foo' +//@ has foo/trait.Join.html '//*[@id="impl-Join-for-Foo"]//h3[@class="code-header"]' 'impl Join for Foo' pub use realcore::Join; diff --git a/tests/rustdoc/impossible-default.rs b/tests/rustdoc/impossible-default.rs index 24d6e3bdac1..fad64068010 100644 --- a/tests/rustdoc/impossible-default.rs +++ b/tests/rustdoc/impossible-default.rs @@ -11,9 +11,9 @@ pub trait Foo { fn no_needs_sized(&self) {} } -// @!has foo/struct.Bar.html '//*[@id="method.needs_sized"]//h4[@class="code-header"]' \ +//@ !has foo/struct.Bar.html '//*[@id="method.needs_sized"]//h4[@class="code-header"]' \ // "fn needs_sized" -// @has foo/struct.Bar.html '//*[@id="method.no_needs_sized"]//h4[@class="code-header"]' \ +//@ has foo/struct.Bar.html '//*[@id="method.no_needs_sized"]//h4[@class="code-header"]' \ // "fn no_needs_sized" pub struct Bar([u8]); diff --git a/tests/rustdoc/include_str_cut.rs b/tests/rustdoc/include_str_cut.rs index cbc1ba8db75..27336c95a69 100644 --- a/tests/rustdoc/include_str_cut.rs +++ b/tests/rustdoc/include_str_cut.rs @@ -1,7 +1,7 @@ #![crate_name = "foo"] #![no_std] -// @has 'foo/fn.foo.html' -// @has - '//*[@class="docblock"]' 'inc2 x' +//@ has 'foo/fn.foo.html' +//@ has - '//*[@class="docblock"]' 'inc2 x' #[doc = include_str!("short-line.md")] pub fn foo() {} diff --git a/tests/rustdoc/index-page.rs b/tests/rustdoc/index-page.rs index 51354c8b25b..ea8a0ee17e7 100644 --- a/tests/rustdoc/index-page.rs +++ b/tests/rustdoc/index-page.rs @@ -4,8 +4,8 @@ #![crate_name = "foo"] -// @has foo/../index.html -// @has - '//h1' 'List of all crates' -// @has - '//ul[@class="all-items"]//a[@href="foo/index.html"]' 'foo' -// @has - '//ul[@class="all-items"]//a[@href="all_item_types/index.html"]' 'all_item_types' +//@ has foo/../index.html +//@ has - '//h1' 'List of all crates' +//@ has - '//ul[@class="all-items"]//a[@href="foo/index.html"]' 'foo' +//@ has - '//ul[@class="all-items"]//a[@href="all_item_types/index.html"]' 'all_item_types' pub struct Foo; diff --git a/tests/rustdoc/infinite-redirection-16265-1.rs b/tests/rustdoc/infinite-redirection-16265-1.rs index 7d72469bd72..5eefde7b919 100644 --- a/tests/rustdoc/infinite-redirection-16265-1.rs +++ b/tests/rustdoc/infinite-redirection-16265-1.rs @@ -3,7 +3,7 @@ pub struct Foo; -// @hasraw issue_16265_1/traits/index.html 'source' +//@ hasraw issue_16265_1/traits/index.html 'source' pub mod traits { impl PartialEq for super::Foo { fn eq(&self, _: &super::Foo) -> bool { diff --git a/tests/rustdoc/infinite-redirection-16265-2.rs b/tests/rustdoc/infinite-redirection-16265-2.rs index 7a4791c5fd4..9c680e29f83 100644 --- a/tests/rustdoc/infinite-redirection-16265-2.rs +++ b/tests/rustdoc/infinite-redirection-16265-2.rs @@ -1,7 +1,7 @@ // https://github.com/rust-lang/rust/issues/16265 #![crate_name="issue_16265_2"] -// @hasraw issue_16265_2/index.html 'source' +//@ hasraw issue_16265_2/index.html 'source' trait Y {} impl Y for Option {} diff --git a/tests/rustdoc/infinite-redirection.rs b/tests/rustdoc/infinite-redirection.rs index f037a8e1a83..9ac559fbecf 100644 --- a/tests/rustdoc/infinite-redirection.rs +++ b/tests/rustdoc/infinite-redirection.rs @@ -4,12 +4,12 @@ // file which redirects to itself). // We check it's not a redirection file. -// @has 'foo/builders/struct.ActionRowBuilder.html' -// @has - '//*[@id="synthetic-implementations"]' 'Auto Trait Implementations' +//@ has 'foo/builders/struct.ActionRowBuilder.html' +//@ has - '//*[@id="synthetic-implementations"]' 'Auto Trait Implementations' // And that the link in the module is targeting it. -// @has 'foo/builders/index.html' -// @has - '//a[@href="struct.ActionRowBuilder.html"]' 'ActionRowBuilder' +//@ has 'foo/builders/index.html' +//@ has - '//a[@href="struct.ActionRowBuilder.html"]' 'ActionRowBuilder' mod auto { mod action_row { diff --git a/tests/rustdoc/inherent-projections.rs b/tests/rustdoc/inherent-projections.rs index 25f51282617..4fc769f70f5 100644 --- a/tests/rustdoc/inherent-projections.rs +++ b/tests/rustdoc/inherent-projections.rs @@ -1,9 +1,9 @@ #![feature(inherent_associated_types)] #![allow(incomplete_features)] -// @has 'inherent_projections/fn.create.html' -// @has - '//pre[@class="rust item-decl"]' "create() -> Owner::Metadata" -// @has - '//pre[@class="rust item-decl"]//a[@class="associatedtype"]/@href' 'struct.Owner.html#associatedtype.Metadata' +//@ has 'inherent_projections/fn.create.html' +//@ has - '//pre[@class="rust item-decl"]' "create() -> Owner::Metadata" +//@ has - '//pre[@class="rust item-decl"]//a[@class="associatedtype"]/@href' 'struct.Owner.html#associatedtype.Metadata' pub fn create() -> Owner::Metadata {} pub struct Owner; @@ -13,7 +13,7 @@ impl Owner { } // Make sure we handle bound vars correctly. -// @has 'inherent_projections/fn.user.html' '//pre[@class="rust item-decl"]' "user(_: for<'a> fn(_: Carrier<'a>::Focus))" +//@ has 'inherent_projections/fn.user.html' '//pre[@class="rust item-decl"]' "user(_: for<'a> fn(_: Carrier<'a>::Focus))" pub fn user(_: for<'a> fn(Carrier<'a>::Focus)) {} pub struct Carrier<'a>(&'a ()); @@ -27,10 +27,10 @@ impl<'a> Carrier<'a> { // FIXME(inherent_associated_types): Below we link to `Proj` but we should link to `Proj-1`. // The current test checks for the buggy behavior for demonstration purposes. -// @has 'inherent_projections/fn.test.html' -// @has - '//pre[@class="rust item-decl"]' "test(_: Parametrized::Proj)" -// @has - '//pre[@class="rust item-decl"]//a[@class="associatedtype"]/@href' 'struct.Parametrized.html#associatedtype.Proj' -// @!has - '//pre[@class="rust item-decl"]//a[@class="associatedtype"]/@href' 'struct.Parametrized.html#associatedtype.Proj-1' +//@ has 'inherent_projections/fn.test.html' +//@ has - '//pre[@class="rust item-decl"]' "test(_: Parametrized::Proj)" +//@ has - '//pre[@class="rust item-decl"]//a[@class="associatedtype"]/@href' 'struct.Parametrized.html#associatedtype.Proj' +//@ !has - '//pre[@class="rust item-decl"]//a[@class="associatedtype"]/@href' 'struct.Parametrized.html#associatedtype.Proj-1' pub fn test(_: Parametrized::Proj) {} pub struct Parametrized(T); diff --git a/tests/rustdoc/inline-assoc-type-20727-bindings.rs b/tests/rustdoc/inline-assoc-type-20727-bindings.rs index d270ccfc375..b3447a759df 100644 --- a/tests/rustdoc/inline-assoc-type-20727-bindings.rs +++ b/tests/rustdoc/inline-assoc-type-20727-bindings.rs @@ -6,20 +6,20 @@ extern crate issue_20727; -// @has issue_20727_2/trait.Add.html +//@ has issue_20727_2/trait.Add.html pub trait Add { - // @has - '//pre[@class="rust item-decl"]' 'trait Add {' - // @has - '//pre[@class="rust item-decl"]' 'type Output;' + //@ has - '//pre[@class="rust item-decl"]' 'trait Add {' + //@ has - '//pre[@class="rust item-decl"]' 'type Output;' type Output; - // @has - '//pre[@class="rust item-decl"]' 'fn add(self, rhs: RHS) -> Self::Output;' + //@ has - '//pre[@class="rust item-decl"]' 'fn add(self, rhs: RHS) -> Self::Output;' fn add(self, rhs: RHS) -> Self::Output; } -// @has issue_20727_2/reexport/trait.Add.html +//@ has issue_20727_2/reexport/trait.Add.html pub mod reexport { - // @has - '//pre[@class="rust item-decl"]' 'trait Add {' - // @has - '//pre[@class="rust item-decl"]' 'type Output;' - // @has - '//pre[@class="rust item-decl"]' 'fn add(self, rhs: RHS) -> Self::Output;' + //@ has - '//pre[@class="rust item-decl"]' 'trait Add {' + //@ has - '//pre[@class="rust item-decl"]' 'type Output;' + //@ has - '//pre[@class="rust item-decl"]' 'fn add(self, rhs: RHS) -> Self::Output;' pub use issue_20727::Add; } diff --git a/tests/rustdoc/inline-assoc-type-20727-bounds-deref.rs b/tests/rustdoc/inline-assoc-type-20727-bounds-deref.rs index b8449860531..afb9087cc7a 100644 --- a/tests/rustdoc/inline-assoc-type-20727-bounds-deref.rs +++ b/tests/rustdoc/inline-assoc-type-20727-bounds-deref.rs @@ -8,20 +8,20 @@ extern crate issue_20727; pub trait Bar {} -// @has issue_20727_3/trait.Deref2.html +//@ has issue_20727_3/trait.Deref2.html pub trait Deref2 { - // @has - '//pre[@class="rust item-decl"]' 'trait Deref2 {' - // @has - '//pre[@class="rust item-decl"]' 'type Target: Bar;' + //@ has - '//pre[@class="rust item-decl"]' 'trait Deref2 {' + //@ has - '//pre[@class="rust item-decl"]' 'type Target: Bar;' type Target: Bar; - // @has - '//pre[@class="rust item-decl"]' 'fn deref(&self) -> Self::Target;' + //@ has - '//pre[@class="rust item-decl"]' 'fn deref(&self) -> Self::Target;' fn deref(&self) -> Self::Target; } -// @has issue_20727_3/reexport/trait.Deref2.html +//@ has issue_20727_3/reexport/trait.Deref2.html pub mod reexport { - // @has - '//pre[@class="rust item-decl"]' 'trait Deref2 {' - // @has - '//pre[@class="rust item-decl"]' 'type Target: Bar;' - // @has - '//pre[@class="rust item-decl"]' 'fn deref(&self) -> Self::Target;' + //@ has - '//pre[@class="rust item-decl"]' 'trait Deref2 {' + //@ has - '//pre[@class="rust item-decl"]' 'type Target: Bar;' + //@ has - '//pre[@class="rust item-decl"]' 'fn deref(&self) -> Self::Target;' pub use issue_20727::Deref2; } diff --git a/tests/rustdoc/inline-assoc-type-20727-bounds-index.rs b/tests/rustdoc/inline-assoc-type-20727-bounds-index.rs index 4905d0dc4c5..9dd234e8202 100644 --- a/tests/rustdoc/inline-assoc-type-20727-bounds-index.rs +++ b/tests/rustdoc/inline-assoc-type-20727-bounds-index.rs @@ -6,38 +6,38 @@ extern crate issue_20727; -// @has issue_20727_4/trait.Index.html +//@ has issue_20727_4/trait.Index.html pub trait Index { - // @has - '//pre[@class="rust item-decl"]' 'trait Index {' - // @has - '//pre[@class="rust item-decl"]' 'type Output: ?Sized' + //@ has - '//pre[@class="rust item-decl"]' 'trait Index {' + //@ has - '//pre[@class="rust item-decl"]' 'type Output: ?Sized' type Output: ?Sized; - // @has - '//pre[@class="rust item-decl"]' \ + //@ has - '//pre[@class="rust item-decl"]' \ // 'fn index(&self, index: Idx) -> &Self::Output' fn index(&self, index: Idx) -> &Self::Output; } -// @has issue_20727_4/trait.IndexMut.html +//@ has issue_20727_4/trait.IndexMut.html pub trait IndexMut: Index { - // @has - '//pre[@class="rust item-decl"]' \ + //@ has - '//pre[@class="rust item-decl"]' \ // 'trait IndexMut: Index {' - // @has - '//pre[@class="rust item-decl"]' \ + //@ has - '//pre[@class="rust item-decl"]' \ // 'fn index_mut(&mut self, index: Idx) -> &mut Self::Output;' fn index_mut(&mut self, index: Idx) -> &mut Self::Output; } pub mod reexport { - // @has issue_20727_4/reexport/trait.Index.html - // @has - '//pre[@class="rust item-decl"]' 'trait Indexwhere Idx: ?Sized,{' - // @has - '//pre[@class="rust item-decl"]' 'type Output: ?Sized' - // @has - '//pre[@class="rust item-decl"]' \ + //@ has issue_20727_4/reexport/trait.Index.html + //@ has - '//pre[@class="rust item-decl"]' 'trait Indexwhere Idx: ?Sized,{' + //@ has - '//pre[@class="rust item-decl"]' 'type Output: ?Sized' + //@ has - '//pre[@class="rust item-decl"]' \ // 'fn index(&self, index: Idx) -> &Self::Output' pub use issue_20727::Index; - // @has issue_20727_4/reexport/trait.IndexMut.html - // @has - '//pre[@class="rust item-decl"]' \ + //@ has issue_20727_4/reexport/trait.IndexMut.html + //@ has - '//pre[@class="rust item-decl"]' \ // 'trait IndexMut: Indexwhere Idx: ?Sized,{' - // @has - '//pre[@class="rust item-decl"]' \ + //@ has - '//pre[@class="rust item-decl"]' \ // 'fn index_mut(&mut self, index: Idx) -> &mut Self::Output;' pub use issue_20727::IndexMut; } diff --git a/tests/rustdoc/inline-assoc-type-20727-bounds.rs b/tests/rustdoc/inline-assoc-type-20727-bounds.rs index e6e0490cdd8..bd8d46f4a56 100644 --- a/tests/rustdoc/inline-assoc-type-20727-bounds.rs +++ b/tests/rustdoc/inline-assoc-type-20727-bounds.rs @@ -6,22 +6,22 @@ extern crate issue_20727; -// @has issue_20727/trait.Deref.html +//@ has issue_20727/trait.Deref.html pub trait Deref { - // @has - '//pre[@class="rust item-decl"]' 'trait Deref {' - // @has - '//pre[@class="rust item-decl"]' 'type Target: ?Sized;' + //@ has - '//pre[@class="rust item-decl"]' 'trait Deref {' + //@ has - '//pre[@class="rust item-decl"]' 'type Target: ?Sized;' type Target: ?Sized; - // @has - '//pre[@class="rust item-decl"]' \ + //@ has - '//pre[@class="rust item-decl"]' \ // "fn deref<'a>(&'a self) -> &'a Self::Target;" fn deref<'a>(&'a self) -> &'a Self::Target; } -// @has issue_20727/reexport/trait.Deref.html +//@ has issue_20727/reexport/trait.Deref.html pub mod reexport { - // @has - '//pre[@class="rust item-decl"]' 'trait Deref {' - // @has - '//pre[@class="rust item-decl"]' 'type Target: ?Sized;' - // @has - '//pre[@class="rust item-decl"]' \ + //@ has - '//pre[@class="rust item-decl"]' 'trait Deref {' + //@ has - '//pre[@class="rust item-decl"]' 'type Target: ?Sized;' + //@ has - '//pre[@class="rust item-decl"]' \ // "fn deref<'a>(&'a self) -> &'a Self::Target;" pub use issue_20727::Deref; } diff --git a/tests/rustdoc/inline-default-methods.rs b/tests/rustdoc/inline-default-methods.rs index a3779567376..2f4c0548c7e 100644 --- a/tests/rustdoc/inline-default-methods.rs +++ b/tests/rustdoc/inline-default-methods.rs @@ -3,19 +3,19 @@ extern crate inline_default_methods; -// @has inline_default_methods/trait.Foo.html -// @has - '//pre[@class="rust item-decl"]' '// Required method fn bar(&self);' -// @has - '//pre[@class="rust item-decl"]' '// Provided method fn foo(&mut self)' +//@ has inline_default_methods/trait.Foo.html +//@ has - '//pre[@class="rust item-decl"]' '// Required method fn bar(&self);' +//@ has - '//pre[@class="rust item-decl"]' '// Provided method fn foo(&mut self)' pub use inline_default_methods::Foo; -// @has inline_default_methods/trait.Bar.html -// @has - '//pre[@class="rust item-decl"]' '// Required method fn bar(&self);' -// @has - '//pre[@class="rust item-decl"]' '// Provided methods fn foo1(&mut self)' -// @has - '//pre[@class="rust item-decl"]' 'fn foo2(&mut self)' +//@ has inline_default_methods/trait.Bar.html +//@ has - '//pre[@class="rust item-decl"]' '// Required method fn bar(&self);' +//@ has - '//pre[@class="rust item-decl"]' '// Provided methods fn foo1(&mut self)' +//@ has - '//pre[@class="rust item-decl"]' 'fn foo2(&mut self)' pub use inline_default_methods::Bar; -// @has inline_default_methods/trait.Baz.html -// @has - '//pre[@class="rust item-decl"]' '// Required methods fn bar1(&self);' -// @has - '//pre[@class="rust item-decl"]' 'fn bar2(&self);' -// @has - '//pre[@class="rust item-decl"]' '// Provided method fn foo(&mut self)' +//@ has inline_default_methods/trait.Baz.html +//@ has - '//pre[@class="rust item-decl"]' '// Required methods fn bar1(&self);' +//@ has - '//pre[@class="rust item-decl"]' 'fn bar2(&self);' +//@ has - '//pre[@class="rust item-decl"]' '// Provided method fn foo(&mut self)' pub use inline_default_methods::Baz; diff --git a/tests/rustdoc/inline-private-with-intermediate-doc-hidden.rs b/tests/rustdoc/inline-private-with-intermediate-doc-hidden.rs index ae830c03ea3..752f3843eea 100644 --- a/tests/rustdoc/inline-private-with-intermediate-doc-hidden.rs +++ b/tests/rustdoc/inline-private-with-intermediate-doc-hidden.rs @@ -4,12 +4,12 @@ #![crate_name = "foo"] -// @has 'foo/index.html' +//@ has 'foo/index.html' // There should only be one struct displayed. -// @count - '//*[@id="main-content"]/*[@class="section-header"]' 1 -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs' -// @has - '//*[@id="main-content"]//a[@href="struct.Reexport.html"]' 'Reexport' -// @has - '//*[@id="main-content"]//*[@class="desc docblock-short"]' 'Visible. Original.' +//@ count - '//*[@id="main-content"]/*[@class="section-header"]' 1 +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs' +//@ has - '//*[@id="main-content"]//a[@href="struct.Reexport.html"]' 'Reexport' +//@ has - '//*[@id="main-content"]//*[@class="desc docblock-short"]' 'Visible. Original.' mod private { /// Original. diff --git a/tests/rustdoc/inline-rename-34473.rs b/tests/rustdoc/inline-rename-34473.rs index 7bc92cca1af..7a065adb0db 100644 --- a/tests/rustdoc/inline-rename-34473.rs +++ b/tests/rustdoc/inline-rename-34473.rs @@ -6,8 +6,8 @@ mod second { pub struct SomeTypeWithLongName; } -// @has foo/index.html -// @!hasraw - SomeTypeWithLongName -// @has foo/struct.SomeType.html -// @!has foo/struct.SomeTypeWithLongName.html +//@ has foo/index.html +//@ !hasraw - SomeTypeWithLongName +//@ has foo/struct.SomeType.html +//@ !has foo/struct.SomeTypeWithLongName.html pub use second::{SomeTypeWithLongName as SomeType}; diff --git a/tests/rustdoc/inline_cross/add-docs.rs b/tests/rustdoc/inline_cross/add-docs.rs index a7fbe3c6d0e..d4e0c539070 100644 --- a/tests/rustdoc/inline_cross/add-docs.rs +++ b/tests/rustdoc/inline_cross/add-docs.rs @@ -3,7 +3,7 @@ extern crate inner; -// @has add_docs/struct.MyStruct.html -// @hasraw add_docs/struct.MyStruct.html "Doc comment from ‘pub use’, Doc comment from definition" +//@ has add_docs/struct.MyStruct.html +//@ hasraw add_docs/struct.MyStruct.html "Doc comment from ‘pub use’, Doc comment from definition" /// Doc comment from 'pub use', pub use inner::MyStruct; diff --git a/tests/rustdoc/inline_cross/assoc-const-equality.rs b/tests/rustdoc/inline_cross/assoc-const-equality.rs index cdf74389e76..ec5c2f748ef 100644 --- a/tests/rustdoc/inline_cross/assoc-const-equality.rs +++ b/tests/rustdoc/inline_cross/assoc-const-equality.rs @@ -4,6 +4,6 @@ #![crate_name = "user"] -// @has user/fn.accept.html -// @has - '//pre[@class="rust item-decl"]' 'fn accept(_: impl Trait)' +//@ has user/fn.accept.html +//@ has - '//pre[@class="rust item-decl"]' 'fn accept(_: impl Trait)' pub use assoc_const_equality::accept; diff --git a/tests/rustdoc/inline_cross/assoc-items.rs b/tests/rustdoc/inline_cross/assoc-items.rs index 6b126964a78..94bd8950e75 100644 --- a/tests/rustdoc/inline_cross/assoc-items.rs +++ b/tests/rustdoc/inline_cross/assoc-items.rs @@ -6,37 +6,37 @@ extern crate assoc_items; -// @has foo/struct.MyStruct.html -// @!hasraw - 'PrivateConst' -// @has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8' -// @has - '//*[@class="docblock"]' 'docs for PublicConst' -// @!hasraw - 'private_method' -// @has - '//*[@id="method.public_method"]' 'pub fn public_method()' -// @has - '//*[@class="docblock"]' 'docs for public_method' -// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16' -// @has - '//*[@class="docblock"]' 'dox for ConstNoDefault' -// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16' -// @has - '//div[@class="docblock"]' 'docs for ConstWithDefault' -// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault = i32' -// @has - '//*[@class="docblock"]' 'dox for TypeNoDefault' -// @has - '//*[@id="associatedtype.TypeWithDefault"]' 'type TypeWithDefault = u32' -// @has - '//div[@class="docblock"]' 'docs for TypeWithDefault' -// @has - '//*[@id="method.method_no_default"]' 'fn method_no_default()' -// @has - '//*[@class="docblock"]' 'dox for method_no_default' -// @has - '//*[@id="method.method_with_default"]' 'fn method_with_default()' -// @has - '//div[@class="docblock"]' 'docs for method_with_default' +//@ has foo/struct.MyStruct.html +//@ !hasraw - 'PrivateConst' +//@ has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8' +//@ has - '//*[@class="docblock"]' 'docs for PublicConst' +//@ !hasraw - 'private_method' +//@ has - '//*[@id="method.public_method"]' 'pub fn public_method()' +//@ has - '//*[@class="docblock"]' 'docs for public_method' +//@ has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16' +//@ has - '//*[@class="docblock"]' 'dox for ConstNoDefault' +//@ has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16' +//@ has - '//div[@class="docblock"]' 'docs for ConstWithDefault' +//@ has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault = i32' +//@ has - '//*[@class="docblock"]' 'dox for TypeNoDefault' +//@ has - '//*[@id="associatedtype.TypeWithDefault"]' 'type TypeWithDefault = u32' +//@ has - '//div[@class="docblock"]' 'docs for TypeWithDefault' +//@ has - '//*[@id="method.method_no_default"]' 'fn method_no_default()' +//@ has - '//*[@class="docblock"]' 'dox for method_no_default' +//@ has - '//*[@id="method.method_with_default"]' 'fn method_with_default()' +//@ has - '//div[@class="docblock"]' 'docs for method_with_default' pub use assoc_items::MyStruct; -// @has foo/trait.MyTrait.html -// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16' -// @has - '//*[@class="docblock"]' 'docs for ConstNoDefault' -// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16' -// @has - '//*[@class="docblock"]' 'docs for ConstWithDefault' -// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault' -// @has - '//*[@class="docblock"]' 'docs for TypeNoDefault' -// @has - '//*[@class="docblock"]' 'docs for TypeWithDefault' -// @has - '//*[@id="tymethod.method_no_default"]' 'fn method_no_default()' -// @has - '//*[@class="docblock"]' 'docs for method_no_default' -// @has - '//*[@id="method.method_with_default"]' 'fn method_with_default()' -// @has - '//*[@class="docblock"]' 'docs for method_with_default' +//@ has foo/trait.MyTrait.html +//@ has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16' +//@ has - '//*[@class="docblock"]' 'docs for ConstNoDefault' +//@ has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16' +//@ has - '//*[@class="docblock"]' 'docs for ConstWithDefault' +//@ has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault' +//@ has - '//*[@class="docblock"]' 'docs for TypeNoDefault' +//@ has - '//*[@class="docblock"]' 'docs for TypeWithDefault' +//@ has - '//*[@id="tymethod.method_no_default"]' 'fn method_no_default()' +//@ has - '//*[@class="docblock"]' 'docs for method_no_default' +//@ has - '//*[@id="method.method_with_default"]' 'fn method_with_default()' +//@ has - '//*[@class="docblock"]' 'docs for method_with_default' pub use assoc_items::MyTrait; diff --git a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs index c030e344997..346f7120b5b 100644 --- a/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs +++ b/tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs @@ -6,49 +6,49 @@ //@ ignore-cross-compile extern crate assoc_item_trait_bounds as aux; -// @has main/trait.Main.html -// @has - '//*[@id="associatedtype.Out0"]' 'type Out0: Support' -// @has - '//*[@id="associatedtype.Out1"]' 'type Out1: Support' -// @has - '//*[@id="associatedtype.Out2"]' 'type Out2: Support' -// @has - '//*[@id="associatedtype.Out3"]' 'type Out3: Support = bool>' -// @has - '//*[@id="associatedtype.Out4"]' 'type Out4: Support = T>' -// @has - '//*[@id="associatedtype.Out5"]' "type Out5: Support = &'static ()>" -// @has - '//*[@id="associatedtype.Out6"]' "type Out6: for<'a> Support = &'a ()>" -// @has - '//*[@id="associatedtype.Out7"]' "type Out7: Support = u32> + Unrelated" -// @has - '//*[@id="associatedtype.Out8"]' "type Out8: Unrelated + Protocol" -// @has - '//*[@id="associatedtype.Out9"]' "type Out9: FnMut(i32) -> bool + Clone" -// @has - '//*[@id="associatedtype.Out10"]' "type Out10<'q>: Support = ()>" -// @has - '//*[@id="associatedtype.Out11"]' "type Out11: for<'r, 's> Helper = &'s (), B<'r> = ()>" -// @has - '//*[@id="associatedtype.Out12"]' "type Out12: for<'w> Helper = Cow<'w, str>, A<'w> = bool>" -// @has - '//*[@id="associatedtype.Out13"]' "type Out13: for<'fst, 'snd> Aid<'snd, Result<'fst> = &'fst mut str>" -// @has - '//*[@id="associatedtype.Out14"]' "type Out14" +//@ has main/trait.Main.html +//@ has - '//*[@id="associatedtype.Out0"]' 'type Out0: Support' +//@ has - '//*[@id="associatedtype.Out1"]' 'type Out1: Support' +//@ has - '//*[@id="associatedtype.Out2"]' 'type Out2: Support' +//@ has - '//*[@id="associatedtype.Out3"]' 'type Out3: Support = bool>' +//@ has - '//*[@id="associatedtype.Out4"]' 'type Out4: Support = T>' +//@ has - '//*[@id="associatedtype.Out5"]' "type Out5: Support = &'static ()>" +//@ has - '//*[@id="associatedtype.Out6"]' "type Out6: for<'a> Support = &'a ()>" +//@ has - '//*[@id="associatedtype.Out7"]' "type Out7: Support = u32> + Unrelated" +//@ has - '//*[@id="associatedtype.Out8"]' "type Out8: Unrelated + Protocol" +//@ has - '//*[@id="associatedtype.Out9"]' "type Out9: FnMut(i32) -> bool + Clone" +//@ has - '//*[@id="associatedtype.Out10"]' "type Out10<'q>: Support = ()>" +//@ has - '//*[@id="associatedtype.Out11"]' "type Out11: for<'r, 's> Helper = &'s (), B<'r> = ()>" +//@ has - '//*[@id="associatedtype.Out12"]' "type Out12: for<'w> Helper = Cow<'w, str>, A<'w> = bool>" +//@ has - '//*[@id="associatedtype.Out13"]' "type Out13: for<'fst, 'snd> Aid<'snd, Result<'fst> = &'fst mut str>" +//@ has - '//*[@id="associatedtype.Out14"]' "type Out14" // // Snapshots: // Check that we don't render any where-clauses for the following associated types since // all corresponding projection equality predicates should have already been re-sugared // to associated type bindings: // -// @snapshot out0 - '//*[@id="associatedtype.Out0"]/*[@class="code-header"]' -// @snapshot out2 - '//*[@id="associatedtype.Out2"]/*[@class="code-header"]' -// @snapshot out9 - '//*[@id="associatedtype.Out9"]/*[@class="code-header"]' +//@ snapshot out0 - '//*[@id="associatedtype.Out0"]/*[@class="code-header"]' +//@ snapshot out2 - '//*[@id="associatedtype.Out2"]/*[@class="code-header"]' +//@ snapshot out9 - '//*[@id="associatedtype.Out9"]/*[@class="code-header"]' // -// @has - '//*[@id="tymethod.make"]' \ +//@ has - '//*[@id="tymethod.make"]' \ // "fn make(_: F, _: impl FnMut(&str) -> bool)\ // where \ // F: FnOnce(u32) -> String, \ // Self::Out2<()>: Protocol" pub use aux::Main; -// @has main/trait.Aid.html -// @has - '//*[@id="associatedtype.Result"]' "type Result<'inter: 'src>" +//@ has main/trait.Aid.html +//@ has - '//*[@id="associatedtype.Result"]' "type Result<'inter: 'src>" pub use aux::Aid; // Below, ensure that we correctly display generic parameters and where-clauses on // associated types inside trait *impls*. More particularly, check that we don't render // any bounds (here `Self::Alias: ...`) as item bounds unlike all the trait test cases above. -// @has main/struct.Implementor.html -// @has - '//*[@id="associatedtype.Alias"]' \ +//@ has main/struct.Implementor.html +//@ has - '//*[@id="associatedtype.Alias"]' \ // "type Alias = T \ // where \ // String: From, \ diff --git a/tests/rustdoc/inline_cross/async-fn.rs b/tests/rustdoc/inline_cross/async-fn.rs index 20fa409a8dd..fb81c61be60 100644 --- a/tests/rustdoc/inline_cross/async-fn.rs +++ b/tests/rustdoc/inline_cross/async-fn.rs @@ -6,14 +6,14 @@ //@ edition: 2021 #![crate_name = "user"] -// @has user/fn.load.html -// @has - '//pre[@class="rust item-decl"]' "pub async fn load() -> i32" +//@ has user/fn.load.html +//@ has - '//pre[@class="rust item-decl"]' "pub async fn load() -> i32" pub use async_fn::load; -// @has user/trait.Load.html -// @has - '//*[@id="tymethod.run"]' 'async fn run(&self) -> i32' +//@ has user/trait.Load.html +//@ has - '//*[@id="tymethod.run"]' 'async fn run(&self) -> i32' pub use async_fn::Load; -// @has user/struct.Loader.html -// @has - '//*[@id="method.run"]' 'async fn run(&self) -> i32' +//@ has user/struct.Loader.html +//@ has - '//*[@id="method.run"]' 'async fn run(&self) -> i32' pub use async_fn::Loader; diff --git a/tests/rustdoc/inline_cross/attributes.rs b/tests/rustdoc/inline_cross/attributes.rs index ac9e6174dc1..4747f8ad67c 100644 --- a/tests/rustdoc/inline_cross/attributes.rs +++ b/tests/rustdoc/inline_cross/attributes.rs @@ -2,6 +2,6 @@ //@ edition:2021 #![crate_name = "user"] -// @has 'user/struct.NonExhaustive.html' -// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[non_exhaustive]' +//@ has 'user/struct.NonExhaustive.html' +//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[non_exhaustive]' pub use attributes::NonExhaustive; diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-85454.rs b/tests/rustdoc/inline_cross/auxiliary/issue-85454.rs index 5db4fe053af..be1ec49fdcc 100644 --- a/tests/rustdoc/inline_cross/auxiliary/issue-85454.rs +++ b/tests/rustdoc/inline_cross/auxiliary/issue-85454.rs @@ -1,5 +1,5 @@ -// @has issue_85454/trait.FromResidual.html -// @has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; }' +//@ has issue_85454/trait.FromResidual.html +//@ has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; }' pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; } diff --git a/tests/rustdoc/inline_cross/const-effect-param.rs b/tests/rustdoc/inline_cross/const-effect-param.rs index 72c90ab6968..a3dcbb3ff0f 100644 --- a/tests/rustdoc/inline_cross/const-effect-param.rs +++ b/tests/rustdoc/inline_cross/const-effect-param.rs @@ -6,23 +6,23 @@ #![crate_name = "user"] // Don't render the host param on `load` and the host arg `host` passed to `Resource`. -// @has user/fn.load.html -// @has - '//pre[@class="rust item-decl"]' "pub const fn load() -> i32\ +//@ has user/fn.load.html +//@ has - '//pre[@class="rust item-decl"]' "pub const fn load() -> i32\ // where \ // R: Resource" pub use const_effect_param::load; // Don't render the host arg `true` passed to `Resource`. -// @has user/fn.lock.html -// @has - '//pre[@class="rust item-decl"]' "pub const fn lock()\ +//@ has user/fn.lock.html +//@ has - '//pre[@class="rust item-decl"]' "pub const fn lock()\ // where \ // R: Resource" pub use const_effect_param::lock; // Regression test for an issue introduced in PR #116670. // Don't hide the const param `host` since it actually isn't the host effect param. -// @has user/fn.clash.html -// @has - '//pre[@class="rust item-decl"]' \ +//@ has user/fn.clash.html +//@ has - '//pre[@class="rust item-decl"]' \ // "pub const fn clash()\ // where \ // T: Clash" diff --git a/tests/rustdoc/inline_cross/const-eval-46727.rs b/tests/rustdoc/inline_cross/const-eval-46727.rs index 213664a90b9..e68bf6a9d27 100644 --- a/tests/rustdoc/inline_cross/const-eval-46727.rs +++ b/tests/rustdoc/inline_cross/const-eval-46727.rs @@ -5,6 +5,6 @@ extern crate issue_46727; -// @has foo/trait.Foo.html -// @has - '//h3[@class="code-header"]' 'impl Foo for Bar<[T; 3]>' +//@ has foo/trait.Foo.html +//@ has - '//h3[@class="code-header"]' 'impl Foo for Bar<[T; 3]>' pub use issue_46727::{Foo, Bar}; diff --git a/tests/rustdoc/inline_cross/const-fn-27362.rs b/tests/rustdoc/inline_cross/const-fn-27362.rs index 22b2fa30fec..bc2587b7f00 100644 --- a/tests/rustdoc/inline_cross/const-fn-27362.rs +++ b/tests/rustdoc/inline_cross/const-fn-27362.rs @@ -8,6 +8,6 @@ extern crate issue_27362_aux; pub use issue_27362_aux::*; -// @matches issue_27362/fn.foo.html '//pre' "pub const fn foo()" -// @matches issue_27362/fn.bar.html '//pre' "pub const unsafe fn bar()" -// @matches issue_27362/struct.Foo.html '//h4[@class="code-header"]' "const unsafe fn baz()" +//@ matches issue_27362/fn.foo.html '//pre' "pub const fn foo()" +//@ matches issue_27362/fn.bar.html '//pre' "pub const unsafe fn bar()" +//@ matches issue_27362/struct.Foo.html '//h4[@class="code-header"]' "const unsafe fn baz()" diff --git a/tests/rustdoc/inline_cross/cross-glob.rs b/tests/rustdoc/inline_cross/cross-glob.rs index ae36655936c..d22e48a5d76 100644 --- a/tests/rustdoc/inline_cross/cross-glob.rs +++ b/tests/rustdoc/inline_cross/cross-glob.rs @@ -4,13 +4,13 @@ extern crate inner; -// @has cross_glob/struct.SomeStruct.html -// @has cross_glob/fn.some_fn.html -// @!has cross_glob/enum.Shadowed.html -// @!has cross_glob/index.html '//code' 'pub use inner::*;' +//@ has cross_glob/struct.SomeStruct.html +//@ has cross_glob/fn.some_fn.html +//@ !has cross_glob/enum.Shadowed.html +//@ !has cross_glob/index.html '//code' 'pub use inner::*;' #[doc(inline)] pub use inner::*; // This type shadows the glob-imported enum `Shadowed`. -// @has cross_glob/type.Shadowed.html +//@ has cross_glob/type.Shadowed.html pub type Shadowed = u8; diff --git a/tests/rustdoc/inline_cross/deduplicate-inlined-items-23207.rs b/tests/rustdoc/inline_cross/deduplicate-inlined-items-23207.rs index 374b4d28545..60c2e0f06d3 100644 --- a/tests/rustdoc/inline_cross/deduplicate-inlined-items-23207.rs +++ b/tests/rustdoc/inline_cross/deduplicate-inlined-items-23207.rs @@ -7,6 +7,6 @@ extern crate issue_23207_2; -// @has issue_23207/fmt/index.html -// @count - '//*[@class="struct"]' 1 +//@ has issue_23207/fmt/index.html +//@ count - '//*[@class="struct"]' 1 pub use issue_23207_2::fmt; diff --git a/tests/rustdoc/inline_cross/default-generic-args.rs b/tests/rustdoc/inline_cross/default-generic-args.rs index f006915f153..0469221b3d8 100644 --- a/tests/rustdoc/inline_cross/default-generic-args.rs +++ b/tests/rustdoc/inline_cross/default-generic-args.rs @@ -2,113 +2,113 @@ //@ aux-crate:default_generic_args=default-generic-args.rs //@ edition:2021 -// @has user/type.BoxedStr.html -// @has - '//*[@class="rust item-decl"]//code' "Box" +//@ has user/type.BoxedStr.html +//@ has - '//*[@class="rust item-decl"]//code' "Box" pub use default_generic_args::BoxedStr; -// @has user/type.IntMap.html -// @has - '//*[@class="rust item-decl"]//code' "HashMap" +//@ has user/type.IntMap.html +//@ has - '//*[@class="rust item-decl"]//code' "HashMap" pub use default_generic_args::IntMap; -// @has user/type.T0.html -// @has - '//*[@class="rust item-decl"]//code' "TyPair" +//@ has user/type.T0.html +//@ has - '//*[@class="rust item-decl"]//code' "TyPair" pub use default_generic_args::T0; -// @has user/type.T1.html -// @has - '//*[@class="rust item-decl"]//code' "TyPair" +//@ has user/type.T1.html +//@ has - '//*[@class="rust item-decl"]//code' "TyPair" pub use default_generic_args::T1; -// @has user/type.T2.html -// @has - '//*[@class="rust item-decl"]//code' "TyPair" +//@ has user/type.T2.html +//@ has - '//*[@class="rust item-decl"]//code' "TyPair" pub use default_generic_args::T2; -// @has user/type.T3.html -// @has - '//*[@class="rust item-decl"]//code' "TyPair" +//@ has user/type.T3.html +//@ has - '//*[@class="rust item-decl"]//code' "TyPair" pub use default_generic_args::T3; -// @has user/type.C0.html -// @has - '//*[@class="rust item-decl"]//code' "CtPair<43>" +//@ has user/type.C0.html +//@ has - '//*[@class="rust item-decl"]//code' "CtPair<43>" pub use default_generic_args::C0; -// @has user/type.C1.html -// @has - '//*[@class="rust item-decl"]//code' "CtPair<0, 1>" +//@ has user/type.C1.html +//@ has - '//*[@class="rust item-decl"]//code' "CtPair<0, 1>" pub use default_generic_args::C1; -// @has user/type.C2.html -// @has - '//*[@class="rust item-decl"]//code' "CtPair" +//@ has user/type.C2.html +//@ has - '//*[@class="rust item-decl"]//code' "CtPair" pub use default_generic_args::C2; -// @has user/type.R0.html -// @has - '//*[@class="rust item-decl"]//code' "Re<'q>" +//@ has user/type.R0.html +//@ has - '//*[@class="rust item-decl"]//code' "Re<'q>" pub use default_generic_args::R0; -// @has user/type.R1.html -// @has - '//*[@class="rust item-decl"]//code' "Re<'q>" +//@ has user/type.R1.html +//@ has - '//*[@class="rust item-decl"]//code' "Re<'q>" pub use default_generic_args::R1; -// @has user/type.R2.html +//@ has user/type.R2.html // Check that we consider regions: -// @has - '//*[@class="rust item-decl"]//code' "Re<'q, &'static ()>" +//@ has - '//*[@class="rust item-decl"]//code' "Re<'q, &'static ()>" pub use default_generic_args::R2; -// @has user/type.H0.html +//@ has user/type.H0.html // Check that we handle higher-ranked regions correctly: -// @has - '//*[@class="rust item-decl"]//code' "fn(_: for<'a> fn(_: Re<'a>))" +//@ has - '//*[@class="rust item-decl"]//code' "fn(_: for<'a> fn(_: Re<'a>))" pub use default_generic_args::H0; -// @has user/type.H1.html +//@ has user/type.H1.html // Check that we don't conflate distinct universially quantified regions (#1): -// @has - '//*[@class="rust item-decl"]//code' "for<'b> fn(_: for<'a> fn(_: Re<'a, &'b ()>))" +//@ has - '//*[@class="rust item-decl"]//code' "for<'b> fn(_: for<'a> fn(_: Re<'a, &'b ()>))" pub use default_generic_args::H1; -// @has user/type.H2.html +//@ has user/type.H2.html // Check that we don't conflate distinct universially quantified regions (#2): -// @has - '//*[@class="rust item-decl"]//code' "for<'a> fn(_: for<'b> fn(_: Re<'a, &'b ()>))" +//@ has - '//*[@class="rust item-decl"]//code' "for<'a> fn(_: for<'b> fn(_: Re<'a, &'b ()>))" pub use default_generic_args::H2; -// @has user/type.P0.html -// @has - '//*[@class="rust item-decl"]//code' "Proj<()>" +//@ has user/type.P0.html +//@ has - '//*[@class="rust item-decl"]//code' "Proj<()>" pub use default_generic_args::P0; -// @has user/type.P1.html -// @has - '//*[@class="rust item-decl"]//code' "Proj<(), bool>" +//@ has user/type.P1.html +//@ has - '//*[@class="rust item-decl"]//code' "Proj<(), bool>" pub use default_generic_args::P1; -// @has user/type.P2.html -// @has - '//*[@class="rust item-decl"]//code' "Proj<(), ()>" +//@ has user/type.P2.html +//@ has - '//*[@class="rust item-decl"]//code' "Proj<(), ()>" pub use default_generic_args::P2; -// @has user/type.A0.html -// @has - '//*[@class="rust item-decl"]//code' "Alpha;" +//@ has user/type.A0.html +//@ has - '//*[@class="rust item-decl"]//code' "Alpha;" pub use default_generic_args::A0; -// @has user/type.A1.html +//@ has user/type.A1.html // Demonstrates that we currently don't elide generic arguments that are alpha-equivalent to their // respective generic parameter (after instantiation) for perf reasons (it would require us to // create an inference context). -// @has - '//*[@class="rust item-decl"]//code' "Alpha fn(_: &'arbitrary ())>" +//@ has - '//*[@class="rust item-decl"]//code' "Alpha fn(_: &'arbitrary ())>" pub use default_generic_args::A1; -// @has user/type.M0.html +//@ has user/type.M0.html // Test that we don't elide `u64` even if it coincides with `A`'s default precisely because // `()` is not the default of `B`. Mindlessly eliding `u64` would lead to `M<()>` which is a // different type (`M<(), u64>` versus `M`). -// @has - '//*[@class="rust item-decl"]//code' "Multi" +//@ has - '//*[@class="rust item-decl"]//code' "Multi" pub use default_generic_args::M0; -// @has user/type.D0.html -// @has - '//*[@class="rust item-decl"]//code' "dyn for<'a> Trait0<'a>" +//@ has user/type.D0.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn for<'a> Trait0<'a>" pub use default_generic_args::D0; // Regression test for issue #119529. // Check that we correctly elide def ty&const args inside trait object types. -// @has user/type.D1.html -// @has - '//*[@class="rust item-decl"]//code' "dyn Trait1" +//@ has user/type.D1.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn Trait1" pub use default_generic_args::D1; -// @has user/type.D2.html -// @has - '//*[@class="rust item-decl"]//code' "dyn Trait1<(), K>" +//@ has user/type.D2.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn Trait1<(), K>" pub use default_generic_args::D2; -// @has user/type.D3.html -// @has - '//*[@class="rust item-decl"]//code' "dyn Trait1;" +//@ has user/type.D3.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn Trait1;" pub use default_generic_args::D3; diff --git a/tests/rustdoc/inline_cross/default-trait-method.rs b/tests/rustdoc/inline_cross/default-trait-method.rs index 3d943735031..e589fc6cb85 100644 --- a/tests/rustdoc/inline_cross/default-trait-method.rs +++ b/tests/rustdoc/inline_cross/default-trait-method.rs @@ -2,19 +2,19 @@ extern crate foo; -// @has default_trait_method/trait.Item.html -// @has - '//*[@id="tymethod.foo"]' 'fn foo()' -// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()' -// @has - '//*[@id="tymethod.bar"]' 'fn bar()' -// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()' -// @has - '//*[@id="method.baz"]' 'fn baz()' -// @!has - '//*[@id="method.baz"]' 'default fn baz()' +//@ has default_trait_method/trait.Item.html +//@ has - '//*[@id="tymethod.foo"]' 'fn foo()' +//@ !has - '//*[@id="tymethod.foo"]' 'default fn foo()' +//@ has - '//*[@id="tymethod.bar"]' 'fn bar()' +//@ !has - '//*[@id="tymethod.bar"]' 'default fn bar()' +//@ has - '//*[@id="method.baz"]' 'fn baz()' +//@ !has - '//*[@id="method.baz"]' 'default fn baz()' pub use foo::Item; -// @has default_trait_method/struct.Foo.html -// @has - '//*[@id="method.foo"]' 'default fn foo()' -// @has - '//*[@id="method.bar"]' 'fn bar()' -// @!has - '//*[@id="method.bar"]' 'default fn bar()' -// @has - '//*[@id="method.baz"]' 'fn baz()' -// @!has - '//*[@id="method.baz"]' 'default fn baz()' +//@ has default_trait_method/struct.Foo.html +//@ has - '//*[@id="method.foo"]' 'default fn foo()' +//@ has - '//*[@id="method.bar"]' 'fn bar()' +//@ !has - '//*[@id="method.bar"]' 'default fn bar()' +//@ has - '//*[@id="method.baz"]' 'fn baz()' +//@ !has - '//*[@id="method.baz"]' 'default fn baz()' pub use foo::Foo; diff --git a/tests/rustdoc/inline_cross/doc-hidden-extern-trait-impl-29584.rs b/tests/rustdoc/inline_cross/doc-hidden-extern-trait-impl-29584.rs index 4643e8f4750..2459dbdaeed 100644 --- a/tests/rustdoc/inline_cross/doc-hidden-extern-trait-impl-29584.rs +++ b/tests/rustdoc/inline_cross/doc-hidden-extern-trait-impl-29584.rs @@ -6,6 +6,6 @@ extern crate issue_29584; -// @has issue_29584/struct.Foo.html -// @!hasraw - 'impl Bar for' +//@ has issue_29584/struct.Foo.html +//@ !hasraw - 'impl Bar for' pub use issue_29584::Foo; diff --git a/tests/rustdoc/inline_cross/dyn_trait.rs b/tests/rustdoc/inline_cross/dyn_trait.rs index 18404556984..b93dc921212 100644 --- a/tests/rustdoc/inline_cross/dyn_trait.rs +++ b/tests/rustdoc/inline_cross/dyn_trait.rs @@ -6,140 +6,140 @@ //@ aux-crate:dyn_trait=dyn_trait.rs //@ edition:2021 -// @has user/type.Ty0.html -// @has - '//*[@class="rust item-decl"]//code' "dyn for<'any> FnOnce(&'any str) -> bool;" +//@ has user/type.Ty0.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn for<'any> FnOnce(&'any str) -> bool;" pub use dyn_trait::Ty0; -// @has user/type.Ty1.html -// @has - '//*[@class="rust item-decl"]//code' "dyn Display + 'obj;" +//@ has user/type.Ty1.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn Display + 'obj;" pub use dyn_trait::Ty1; -// @has user/type.Ty2.html -// @has - '//*[@class="rust item-decl"]//code' "dyn for<'a, 'r> Container<'r, Item<'a, 'static> = ()>;" +//@ has user/type.Ty2.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn for<'a, 'r> Container<'r, Item<'a, 'static> = ()>;" pub use dyn_trait::Ty2; -// @has user/type.Ty3.html -// @has - '//*[@class="rust item-decl"]//code' "&'s dyn ToString;" +//@ has user/type.Ty3.html +//@ has - '//*[@class="rust item-decl"]//code' "&'s dyn ToString;" pub use dyn_trait::Ty3; // Below we check if we correctly elide trait-object lifetime bounds if they coincide with their // default (known as "object lifetime default" or "default trait object lifetime"). -// @has user/fn.lbwel.html -// @has - '//pre[@class="rust item-decl"]' "lbwel(_: &dyn Fn())" +//@ has user/fn.lbwel.html +//@ has - '//pre[@class="rust item-decl"]' "lbwel(_: &dyn Fn())" pub use dyn_trait::late_bound_wrapped_elided as lbwel; -// @has user/fn.lbwl0.html -// has - '//pre[@class="rust item-decl"]' "lbwl0<'f>(_: &mut (dyn Fn() + 'f))" +//@ has user/fn.lbwl0.html +//@ has - '//pre[@class="rust item-decl"]' "lbwl0<'f>(_: &mut (dyn Fn() + 'f))" pub use dyn_trait::late_bound_wrapped_late0 as lbwl0; -// @has user/fn.lbwd0.html -// has - '//pre[@class="rust item-decl"]' "lbwd0<'f>(_: &'f mut dyn Fn())" +//@ has user/fn.lbwd0.html +//@ has - '//pre[@class="rust item-decl"]' "lbwd0<'f>(_: &'f mut dyn Fn())" pub use dyn_trait::late_bound_wrapped_defaulted0 as lbwd0; -// @has user/type.EarlyBoundWrappedDefaulted0.html -// @has - '//*[@class="rust item-decl"]//code' "Ref<'x, dyn Trait>;" +//@ has user/type.EarlyBoundWrappedDefaulted0.html +//@ has - '//*[@class="rust item-decl"]//code' "Ref<'x, dyn Trait>;" pub use dyn_trait::EarlyBoundWrappedDefaulted0; -// @has user/type.EarlyBoundWrappedDefaulted1.html -// @has - '//*[@class="rust item-decl"]//code' "&'x dyn Trait;" +//@ has user/type.EarlyBoundWrappedDefaulted1.html +//@ has - '//*[@class="rust item-decl"]//code' "&'x dyn Trait;" pub use dyn_trait::EarlyBoundWrappedDefaulted1; -// @has user/type.EarlyBoundWrappedEarly.html -// @has - '//*[@class="rust item-decl"]//code' "Ref<'x, dyn Trait + 'y>" +//@ has user/type.EarlyBoundWrappedEarly.html +//@ has - '//*[@class="rust item-decl"]//code' "Ref<'x, dyn Trait + 'y>" pub use dyn_trait::EarlyBoundWrappedEarly; -// @has user/type.EarlyBoundWrappedStatic.html -// @has - '//*[@class="rust item-decl"]//code' "Ref<'x, dyn Trait + 'static>" +//@ has user/type.EarlyBoundWrappedStatic.html +//@ has - '//*[@class="rust item-decl"]//code' "Ref<'x, dyn Trait + 'static>" pub use dyn_trait::EarlyBoundWrappedStatic; -// @has user/fn.lbwd1.html -// @has - '//pre[@class="rust item-decl"]' "lbwd1<'l>(_: Ref<'l, dyn Trait>)" +//@ has user/fn.lbwd1.html +//@ has - '//pre[@class="rust item-decl"]' "lbwd1<'l>(_: Ref<'l, dyn Trait>)" pub use dyn_trait::late_bound_wrapped_defaulted1 as lbwd1; -// @has user/fn.lbwl1.html -// @has - '//pre[@class="rust item-decl"]' "lbwl1<'l, 'm>(_: Ref<'l, dyn Trait + 'm>)" +//@ has user/fn.lbwl1.html +//@ has - '//pre[@class="rust item-decl"]' "lbwl1<'l, 'm>(_: Ref<'l, dyn Trait + 'm>)" pub use dyn_trait::late_bound_wrapped_late1 as lbwl1; -// @has user/fn.lbwe.html -// @has - '//pre[@class="rust item-decl"]' "lbwe<'e, 'l>(_: Ref<'l, dyn Trait + 'e>)" +//@ has user/fn.lbwe.html +//@ has - '//pre[@class="rust item-decl"]' "lbwe<'e, 'l>(_: Ref<'l, dyn Trait + 'e>)" pub use dyn_trait::late_bound_wrapped_early as lbwe; -// @has user/fn.ebwd.html -// @has - '//pre[@class="rust item-decl"]' "ebwd(_: Ref<'_, dyn Trait>)" +//@ has user/fn.ebwd.html +//@ has - '//pre[@class="rust item-decl"]' "ebwd(_: Ref<'_, dyn Trait>)" pub use dyn_trait::elided_bound_wrapped_defaulted as ebwd; -// @has user/type.StaticBoundWrappedDefaulted0.html -// @has - '//*[@class="rust item-decl"]//code' "Ref<'static, dyn Trait>;" +//@ has user/type.StaticBoundWrappedDefaulted0.html +//@ has - '//*[@class="rust item-decl"]//code' "Ref<'static, dyn Trait>;" pub use dyn_trait::StaticBoundWrappedDefaulted0; -// @has user/type.StaticBoundWrappedDefaulted1.html -// @has - '//*[@class="rust item-decl"]//code' "&'static dyn Trait;" +//@ has user/type.StaticBoundWrappedDefaulted1.html +//@ has - '//*[@class="rust item-decl"]//code' "&'static dyn Trait;" pub use dyn_trait::StaticBoundWrappedDefaulted1; -// @has user/type.AmbiguousBoundWrappedEarly0.html -// @has - '//*[@class="rust item-decl"]//code' "AmbiguousBoundWrapper<'s, 'r, dyn Trait + 's>;" +//@ has user/type.AmbiguousBoundWrappedEarly0.html +//@ has - '//*[@class="rust item-decl"]//code' "AmbiguousBoundWrapper<'s, 'r, dyn Trait + 's>;" pub use dyn_trait::AmbiguousBoundWrappedEarly0; -// @has user/type.AmbiguousBoundWrappedEarly1.html -// @has - '//*[@class="rust item-decl"]//code' "AmbiguousBoundWrapper<'s, 'r, dyn Trait + 'r>;" +//@ has user/type.AmbiguousBoundWrappedEarly1.html +//@ has - '//*[@class="rust item-decl"]//code' "AmbiguousBoundWrapper<'s, 'r, dyn Trait + 'r>;" pub use dyn_trait::AmbiguousBoundWrappedEarly1; -// @has user/type.AmbiguousBoundWrappedStatic.html -// @has - '//*[@class="rust item-decl"]//code' "AmbiguousBoundWrapper<'q, 'q, dyn Trait + 'static>;" +//@ has user/type.AmbiguousBoundWrappedStatic.html +//@ has - '//*[@class="rust item-decl"]//code' "AmbiguousBoundWrapper<'q, 'q, dyn Trait + 'static>;" pub use dyn_trait::AmbiguousBoundWrappedStatic; -// @has user/type.NoBoundsWrappedDefaulted.html -// @has - '//*[@class="rust item-decl"]//code' "Box;" +//@ has user/type.NoBoundsWrappedDefaulted.html +//@ has - '//*[@class="rust item-decl"]//code' "Box;" pub use dyn_trait::NoBoundsWrappedDefaulted; -// @has user/type.NoBoundsWrappedEarly.html -// @has - '//*[@class="rust item-decl"]//code' "Box;" +//@ has user/type.NoBoundsWrappedEarly.html +//@ has - '//*[@class="rust item-decl"]//code' "Box;" pub use dyn_trait::NoBoundsWrappedEarly; -// @has user/fn.nbwl.html -// @has - '//pre[@class="rust item-decl"]' "nbwl<'l>(_: Box)" +//@ has user/fn.nbwl.html +//@ has - '//pre[@class="rust item-decl"]' "nbwl<'l>(_: Box)" pub use dyn_trait::no_bounds_wrapped_late as nbwl; -// @has user/fn.nbwel.html -// @has - '//pre[@class="rust item-decl"]' "nbwel(_: Box)" +//@ has user/fn.nbwel.html +//@ has - '//pre[@class="rust item-decl"]' "nbwel(_: Box)" // NB: It might seem counterintuitive to display the explicitly elided lifetime `'_` here instead of // eliding it but this behavior is correct: The default is `'static` here which != `'_`. pub use dyn_trait::no_bounds_wrapped_elided as nbwel; -// @has user/type.BareNoBoundsDefaulted.html -// @has - '//*[@class="rust item-decl"]//code' "dyn Trait;" +//@ has user/type.BareNoBoundsDefaulted.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn Trait;" pub use dyn_trait::BareNoBoundsDefaulted; -// @has user/type.BareNoBoundsEarly.html -// @has - '//*[@class="rust item-decl"]//code' "dyn Trait + 'p;" +//@ has user/type.BareNoBoundsEarly.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn Trait + 'p;" pub use dyn_trait::BareNoBoundsEarly; -// @has user/type.BareEarlyBoundDefaulted0.html -// @has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait0<'u>;" +//@ has user/type.BareEarlyBoundDefaulted0.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait0<'u>;" pub use dyn_trait::BareEarlyBoundDefaulted0; -// @has user/type.BareEarlyBoundDefaulted1.html -// @has - '//*[@class="rust item-decl"]//code' "dyn for<'any> EarlyBoundTrait0<'any>;" +//@ has user/type.BareEarlyBoundDefaulted1.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn for<'any> EarlyBoundTrait0<'any>;" pub use dyn_trait::BareEarlyBoundDefaulted1; -// @has user/type.BareEarlyBoundDefaulted2.html -// @has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait1<'static, 'w>;" +//@ has user/type.BareEarlyBoundDefaulted2.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait1<'static, 'w>;" pub use dyn_trait::BareEarlyBoundDefaulted2; -// @has user/type.BareEarlyBoundEarly.html -// @has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait0<'i> + 'j;" +//@ has user/type.BareEarlyBoundEarly.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait0<'i> + 'j;" pub use dyn_trait::BareEarlyBoundEarly; -// @has user/type.BareEarlyBoundStatic.html -// @has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait0<'i> + 'static;" +//@ has user/type.BareEarlyBoundStatic.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn EarlyBoundTrait0<'i> + 'static;" pub use dyn_trait::BareEarlyBoundStatic; -// @has user/type.BareStaticBoundDefaulted.html -// @has - '//*[@class="rust item-decl"]//code' "dyn StaticBoundTrait;" +//@ has user/type.BareStaticBoundDefaulted.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn StaticBoundTrait;" pub use dyn_trait::BareStaticBoundDefaulted; -// @has user/type.BareHigherRankedBoundDefaulted0.html -// @has - '//*[@class="rust item-decl"]//code' "dyn HigherRankedBoundTrait0;" +//@ has user/type.BareHigherRankedBoundDefaulted0.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn HigherRankedBoundTrait0;" pub use dyn_trait::BareHigherRankedBoundDefaulted0; -// @has user/type.BareHigherRankedBoundDefaulted1.html -// @has - '//*[@class="rust item-decl"]//code' "dyn HigherRankedBoundTrait1<'r>;" +//@ has user/type.BareHigherRankedBoundDefaulted1.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn HigherRankedBoundTrait1<'r>;" pub use dyn_trait::BareHigherRankedBoundDefaulted1; -// @has user/type.BareAmbiguousBoundEarly0.html -// @has - '//*[@class="rust item-decl"]//code' "dyn AmbiguousBoundTrait<'m, 'n> + 'm;" +//@ has user/type.BareAmbiguousBoundEarly0.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn AmbiguousBoundTrait<'m, 'n> + 'm;" pub use dyn_trait::BareAmbiguousBoundEarly0; -// @has user/type.BareAmbiguousBoundEarly1.html -// @has - '//*[@class="rust item-decl"]//code' "dyn AmbiguousBoundTrait<'m, 'n> + 'n;" +//@ has user/type.BareAmbiguousBoundEarly1.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn AmbiguousBoundTrait<'m, 'n> + 'n;" pub use dyn_trait::BareAmbiguousBoundEarly1; -// @has user/type.BareAmbiguousBoundStatic.html -// @has - '//*[@class="rust item-decl"]//code' "dyn AmbiguousBoundTrait<'o, 'o> + 'static;" +//@ has user/type.BareAmbiguousBoundStatic.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn AmbiguousBoundTrait<'o, 'o> + 'static;" pub use dyn_trait::BareAmbiguousBoundStatic; // Regression test for issue #115179: -// @has user/type.NestedTraitObjects.html -// @has - '//*[@class="rust item-decl"]//code' "dyn Outer;" +//@ has user/type.NestedTraitObjects.html +//@ has - '//*[@class="rust item-decl"]//code' "dyn Outer;" pub use dyn_trait::NestedTraitObjects; -// @has user/fn.apit_rpit.html -// @has - '//pre[@class="rust item-decl"]' \ +//@ has user/fn.apit_rpit.html +//@ has - '//pre[@class="rust item-decl"]' \ // "apit_rpit(o: impl Outer) -> impl Outer" pub use dyn_trait::apit_rpit; -// @has user/type.AssocTy.html -// @has - '//*[@class="rust item-decl"]//code' "<() as Base>::Type" +//@ has user/type.AssocTy.html +//@ has - '//*[@class="rust item-decl"]//code' "<() as Base>::Type" pub use dyn_trait::AssocTy; diff --git a/tests/rustdoc/inline_cross/early-late-bound-lifetime-params.rs b/tests/rustdoc/inline_cross/early-late-bound-lifetime-params.rs index 97dd623bb07..36542a2d6fc 100644 --- a/tests/rustdoc/inline_cross/early-late-bound-lifetime-params.rs +++ b/tests/rustdoc/inline_cross/early-late-bound-lifetime-params.rs @@ -8,10 +8,10 @@ //@ aux-crate:dep=early-late-bound-lifetime-params.rs //@ edition:2021 -// @has usr/fn.f.html -// @has - '//pre[@class="rust item-decl"]' "fn f<'a, 'b, 'c, 'd, T, const N: usize>(_: impl Copy)" +//@ has usr/fn.f.html +//@ has - '//pre[@class="rust item-decl"]' "fn f<'a, 'b, 'c, 'd, T, const N: usize>(_: impl Copy)" pub use dep::f; -// @has usr/struct.Ty.html -// @has - '//*[@id="method.f"]' "fn f<'a, 'b, 'c, 'd, T, const N: usize>(_: impl Copy)" +//@ has usr/struct.Ty.html +//@ has - '//*[@id="method.f"]' "fn f<'a, 'b, 'c, 'd, T, const N: usize>(_: impl Copy)" pub use dep::Ty; diff --git a/tests/rustdoc/inline_cross/fn-type.rs b/tests/rustdoc/inline_cross/fn-type.rs index 222557a4663..8db6f65f421 100644 --- a/tests/rustdoc/inline_cross/fn-type.rs +++ b/tests/rustdoc/inline_cross/fn-type.rs @@ -6,7 +6,7 @@ //@ edition: 2021 #![crate_name = "user"] -// @has user/type.F.html -// @has - '//*[@class="rust item-decl"]//code' \ +//@ has user/type.F.html +//@ has - '//*[@class="rust item-decl"]//code' \ // "for<'z, 'a, '_unused> fn(_: &'z for<'b> fn(_: &'b str), _: &'a ()) -> &'a ();" pub use fn_type::F; diff --git a/tests/rustdoc/inline_cross/generic-const-items.rs b/tests/rustdoc/inline_cross/generic-const-items.rs index 77011a05d2f..70018b6ddb5 100644 --- a/tests/rustdoc/inline_cross/generic-const-items.rs +++ b/tests/rustdoc/inline_cross/generic-const-items.rs @@ -3,23 +3,23 @@ //@ aux-crate:generic_const_items=generic-const-items.rs //@ edition:2021 -// @has 'user/constant.K.html' -// @has - '//*[@class="rust item-decl"]//code' \ +//@ has 'user/constant.K.html' +//@ has - '//*[@class="rust item-decl"]//code' \ // "pub const K<'a, T: 'a + Copy, const N: usize>: Option<[T; N]> \ // where \ // String: From;" pub use generic_const_items::K; -// @has user/trait.Trait.html -// @has - '//*[@id="associatedconstant.C"]' \ +//@ has user/trait.Trait.html +//@ has - '//*[@id="associatedconstant.C"]' \ // "const C<'a>: &'a T \ // where \ // T: 'a + Eq" pub use generic_const_items::Trait; -// @has user/struct.Implementor.html -// @has - '//h3[@class="code-header"]' 'impl Trait for Implementor' -// @has - '//*[@id="associatedconstant.C"]' \ +//@ has user/struct.Implementor.html +//@ has - '//h3[@class="code-header"]' 'impl Trait for Implementor' +//@ has - '//*[@id="associatedconstant.C"]' \ // "const C<'a>: &'a str = \"C\" \ // where \ // str: 'a" diff --git a/tests/rustdoc/inline_cross/hidden-use.rs b/tests/rustdoc/inline_cross/hidden-use.rs index f747c94915c..3f15881345c 100644 --- a/tests/rustdoc/inline_cross/hidden-use.rs +++ b/tests/rustdoc/inline_cross/hidden-use.rs @@ -4,9 +4,9 @@ extern crate rustdoc_hidden; -// @has hidden_use/index.html -// @!hasraw - 'rustdoc_hidden' -// @!hasraw - 'Bar' -// @!has hidden_use/struct.Bar.html +//@ has hidden_use/index.html +//@ !hasraw - 'rustdoc_hidden' +//@ !hasraw - 'Bar' +//@ !has hidden_use/struct.Bar.html #[doc(hidden)] pub use rustdoc_hidden::Bar; diff --git a/tests/rustdoc/inline_cross/impl-inline-without-trait.rs b/tests/rustdoc/inline_cross/impl-inline-without-trait.rs index 60265b5df8f..d2f19400271 100644 --- a/tests/rustdoc/inline_cross/impl-inline-without-trait.rs +++ b/tests/rustdoc/inline_cross/impl-inline-without-trait.rs @@ -6,7 +6,7 @@ extern crate impl_inline_without_trait; -// @has 'foo/struct.MyStruct.html' -// @has - '//*[@id="method.my_trait_method"]' 'fn my_trait_method()' -// @has - '//div[@class="docblock"]' 'docs for my_trait_method' +//@ has 'foo/struct.MyStruct.html' +//@ has - '//*[@id="method.my_trait_method"]' 'fn my_trait_method()' +//@ has - '//div[@class="docblock"]' 'docs for my_trait_method' pub use impl_inline_without_trait::MyStruct; diff --git a/tests/rustdoc/inline_cross/impl-sized.rs b/tests/rustdoc/inline_cross/impl-sized.rs index b62a1e61e2b..edef114422c 100644 --- a/tests/rustdoc/inline_cross/impl-sized.rs +++ b/tests/rustdoc/inline_cross/impl-sized.rs @@ -3,25 +3,25 @@ //@ aux-crate:impl_sized=impl-sized.rs //@ edition:2021 -// @has user/fn.sized.html -// @has - '//pre[@class="rust item-decl"]' "sized(x: impl Sized) -> impl Sized" +//@ has user/fn.sized.html +//@ has - '//pre[@class="rust item-decl"]' "sized(x: impl Sized) -> impl Sized" pub use impl_sized::sized; -// @has user/fn.sized_outlives.html -// @has - '//pre[@class="rust item-decl"]' \ +//@ has user/fn.sized_outlives.html +//@ has - '//pre[@class="rust item-decl"]' \ // "sized_outlives<'a>(x: impl Sized + 'a) -> impl Sized + 'a" pub use impl_sized::sized_outlives; -// @has user/fn.maybe_sized.html -// @has - '//pre[@class="rust item-decl"]' "maybe_sized(x: &impl ?Sized) -> &impl ?Sized" +//@ has user/fn.maybe_sized.html +//@ has - '//pre[@class="rust item-decl"]' "maybe_sized(x: &impl ?Sized) -> &impl ?Sized" pub use impl_sized::maybe_sized; -// @has user/fn.debug_maybe_sized.html -// @has - '//pre[@class="rust item-decl"]' \ +//@ has user/fn.debug_maybe_sized.html +//@ has - '//pre[@class="rust item-decl"]' \ // "debug_maybe_sized(x: &(impl Debug + ?Sized)) -> &(impl Debug + ?Sized)" pub use impl_sized::debug_maybe_sized; -// @has user/fn.maybe_sized_outlives.html -// @has - '//pre[@class="rust item-decl"]' \ +//@ has user/fn.maybe_sized_outlives.html +//@ has - '//pre[@class="rust item-decl"]' \ // "maybe_sized_outlives<'t>(x: &(impl ?Sized + 't)) -> &(impl ?Sized + 't)" pub use impl_sized::maybe_sized_outlives; diff --git a/tests/rustdoc/inline_cross/impl_trait.rs b/tests/rustdoc/inline_cross/impl_trait.rs index 19d1673f2eb..e6baf33660a 100644 --- a/tests/rustdoc/inline_cross/impl_trait.rs +++ b/tests/rustdoc/inline_cross/impl_trait.rs @@ -3,37 +3,37 @@ extern crate impl_trait_aux; -// @has impl_trait/fn.func.html -// @has - '//pre[@class="rust item-decl"]' "pub fn func<'a>(_x: impl Clone + Into> + 'a)" -// @!has - '//pre[@class="rust item-decl"]' 'where' +//@ has impl_trait/fn.func.html +//@ has - '//pre[@class="rust item-decl"]' "pub fn func<'a>(_x: impl Clone + Into> + 'a)" +//@ !has - '//pre[@class="rust item-decl"]' 'where' pub use impl_trait_aux::func; -// @has impl_trait/fn.func2.html -// @has - '//pre[@class="rust item-decl"]' "func2(" -// @has - '//pre[@class="rust item-decl"]' "_x: impl Deref> + Iterator," -// @has - '//pre[@class="rust item-decl"]' "_y: impl Iterator, )" -// @!has - '//pre[@class="rust item-decl"]' 'where' +//@ has impl_trait/fn.func2.html +//@ has - '//pre[@class="rust item-decl"]' "func2(" +//@ has - '//pre[@class="rust item-decl"]' "_x: impl Deref> + Iterator," +//@ has - '//pre[@class="rust item-decl"]' "_y: impl Iterator, )" +//@ !has - '//pre[@class="rust item-decl"]' 'where' pub use impl_trait_aux::func2; -// @has impl_trait/fn.func3.html -// @has - '//pre[@class="rust item-decl"]' "func3(" -// @has - '//pre[@class="rust item-decl"]' "_x: impl Iterator> + Clone)" -// @!has - '//pre[@class="rust item-decl"]' 'where' +//@ has impl_trait/fn.func3.html +//@ has - '//pre[@class="rust item-decl"]' "func3(" +//@ has - '//pre[@class="rust item-decl"]' "_x: impl Iterator> + Clone)" +//@ !has - '//pre[@class="rust item-decl"]' 'where' pub use impl_trait_aux::func3; -// @has impl_trait/fn.func4.html -// @has - '//pre[@class="rust item-decl"]' "func4(" -// @has - '//pre[@class="rust item-decl"]' "T: Iterator," +//@ has impl_trait/fn.func4.html +//@ has - '//pre[@class="rust item-decl"]' "func4(" +//@ has - '//pre[@class="rust item-decl"]' "T: Iterator," pub use impl_trait_aux::func4; -// @has impl_trait/fn.func5.html -// @has - '//pre[@class="rust item-decl"]' "func5(" -// @has - '//pre[@class="rust item-decl"]' "_f: impl for<'any> Fn(&'any str, &'any str) -> bool + for<'r> Other = ()>," -// @has - '//pre[@class="rust item-decl"]' "_a: impl for<'beta, 'alpha, '_gamma> Auxiliary<'alpha, Item<'beta> = fn(_: &'beta ())>" -// @!has - '//pre[@class="rust item-decl"]' 'where' +//@ has impl_trait/fn.func5.html +//@ has - '//pre[@class="rust item-decl"]' "func5(" +//@ has - '//pre[@class="rust item-decl"]' "_f: impl for<'any> Fn(&'any str, &'any str) -> bool + for<'r> Other = ()>," +//@ has - '//pre[@class="rust item-decl"]' "_a: impl for<'beta, 'alpha, '_gamma> Auxiliary<'alpha, Item<'beta> = fn(_: &'beta ())>" +//@ !has - '//pre[@class="rust item-decl"]' 'where' pub use impl_trait_aux::func5; -// @has impl_trait/struct.Foo.html -// @has - '//*[@id="method.method"]//h4[@class="code-header"]' "pub fn method<'a>(_x: impl Clone + Into> + 'a)" -// @!has - '//*[@id="method.method"]//h4[@class="code-header"]' 'where' +//@ has impl_trait/struct.Foo.html +//@ has - '//*[@id="method.method"]//h4[@class="code-header"]' "pub fn method<'a>(_x: impl Clone + Into> + 'a)" +//@ !has - '//*[@id="method.method"]//h4[@class="code-header"]' 'where' pub use impl_trait_aux::Foo; diff --git a/tests/rustdoc/inline_cross/implementors-js.rs b/tests/rustdoc/inline_cross/implementors-js.rs index 099da54093c..e5b1049ff56 100644 --- a/tests/rustdoc/inline_cross/implementors-js.rs +++ b/tests/rustdoc/inline_cross/implementors-js.rs @@ -4,13 +4,13 @@ extern crate implementors_inline; -// @!has trait.impl/implementors_js/trait.MyTrait.js -// @has trait.impl/implementors_inline/my_trait/trait.MyTrait.js -// @!has trait.impl/implementors_inline/prelude/trait.MyTrait.js -// @has implementors_inline/my_trait/trait.MyTrait.html -// @has - '//script/@src' '../../trait.impl/implementors_inline/my_trait/trait.MyTrait.js' -// @has implementors_js/trait.MyTrait.html -// @has - '//script/@src' '../trait.impl/implementors_inline/my_trait/trait.MyTrait.js' +//@ !has trait.impl/implementors_js/trait.MyTrait.js +//@ has trait.impl/implementors_inline/my_trait/trait.MyTrait.js +//@ !has trait.impl/implementors_inline/prelude/trait.MyTrait.js +//@ has implementors_inline/my_trait/trait.MyTrait.html +//@ has - '//script/@src' '../../trait.impl/implementors_inline/my_trait/trait.MyTrait.js' +//@ has implementors_js/trait.MyTrait.html +//@ has - '//script/@src' '../trait.impl/implementors_inline/my_trait/trait.MyTrait.js' /// When re-exporting this trait, the HTML will be inlined, /// but, vitally, the JavaScript will be located only at the /// one canonical path. diff --git a/tests/rustdoc/inline_cross/inline_hidden.rs b/tests/rustdoc/inline_cross/inline_hidden.rs index 2a3dd72749c..095cd2d3c55 100644 --- a/tests/rustdoc/inline_cross/inline_hidden.rs +++ b/tests/rustdoc/inline_cross/inline_hidden.rs @@ -4,23 +4,23 @@ extern crate rustdoc_hidden; -// @has inline_hidden/index.html +//@ has inline_hidden/index.html // Ensures this item is not inlined. -// @has - '//*[@id="reexport.Foo"]/code' 'pub use rustdoc_hidden::Foo;' +//@ has - '//*[@id="reexport.Foo"]/code' 'pub use rustdoc_hidden::Foo;' #[doc(no_inline)] pub use rustdoc_hidden::Foo; // Even if the foreign item has `doc(hidden)`, we should be able to inline it. -// @has - '//*[@class="item-name"]/a[@class="struct"]' 'Inlined' +//@ has - '//*[@class="item-name"]/a[@class="struct"]' 'Inlined' #[doc(inline)] pub use rustdoc_hidden::Foo as Inlined; // Even with this import, we should not see `Foo`. -// @count - '//*[@class="item-name"]' 4 -// @has - '//*[@class="item-name"]/a[@class="struct"]' 'Bar' -// @has - '//*[@class="item-name"]/a[@class="fn"]' 'foo' +//@ count - '//*[@class="item-name"]' 4 +//@ has - '//*[@class="item-name"]/a[@class="struct"]' 'Bar' +//@ has - '//*[@class="item-name"]/a[@class="fn"]' 'foo' pub use rustdoc_hidden::*; -// @has inline_hidden/fn.foo.html -// @!has - '//a/@title' 'Foo' +//@ has inline_hidden/fn.foo.html +//@ !has - '//a/@title' 'Foo' pub fn foo(_: Foo) {} diff --git a/tests/rustdoc/inline_cross/issue-24183.rs b/tests/rustdoc/inline_cross/issue-24183.rs index cd39cda718b..8299eecc575 100644 --- a/tests/rustdoc/inline_cross/issue-24183.rs +++ b/tests/rustdoc/inline_cross/issue-24183.rs @@ -4,15 +4,15 @@ //@ aux-crate:issue_24183=issue-24183.rs //@ edition: 2021 -// @has usr/trait.U.html -// @has - '//*[@class="rust item-decl"]' "pub trait U {" -// @has - '//*[@id="method.modified"]' \ +//@ has usr/trait.U.html +//@ has - '//*[@class="rust item-decl"]' "pub trait U {" +//@ has - '//*[@id="method.modified"]' \ // "fn modified(self) -> Self\ // where \ // Self: Sized" -// @snapshot method_no_where_self_sized - '//*[@id="method.touch"]/*[@class="code-header"]' +//@ snapshot method_no_where_self_sized - '//*[@id="method.touch"]/*[@class="code-header"]' pub use issue_24183::U; -// @has usr/trait.S.html -// @has - '//*[@class="rust item-decl"]' 'pub trait S: Sized {' +//@ has usr/trait.S.html +//@ has - '//*[@class="rust item-decl"]' 'pub trait S: Sized {' pub use issue_24183::S; diff --git a/tests/rustdoc/inline_cross/issue-28480.rs b/tests/rustdoc/inline_cross/issue-28480.rs index 9d221a46d92..004510fd922 100644 --- a/tests/rustdoc/inline_cross/issue-28480.rs +++ b/tests/rustdoc/inline_cross/issue-28480.rs @@ -2,12 +2,12 @@ //@ build-aux-docs //@ ignore-cross-compile -// @has rustdoc_hidden_sig/struct.Bar.html -// @!has - '//a/@title' 'Hidden' -// @has - '//a' 'u8' +//@ has rustdoc_hidden_sig/struct.Bar.html +//@ !has - '//a/@title' 'Hidden' +//@ has - '//a' 'u8' extern crate rustdoc_hidden_sig; -// @has issue_28480/struct.Bar.html -// @!has - '//a/@title' 'Hidden' -// @has - '//a' 'u8' +//@ has issue_28480/struct.Bar.html +//@ !has - '//a/@title' 'Hidden' +//@ has - '//a' 'u8' pub use rustdoc_hidden_sig::Bar; diff --git a/tests/rustdoc/inline_cross/issue-31948-1.rs b/tests/rustdoc/inline_cross/issue-31948-1.rs index ee053f40638..e59da87c29d 100644 --- a/tests/rustdoc/inline_cross/issue-31948-1.rs +++ b/tests/rustdoc/inline_cross/issue-31948-1.rs @@ -4,24 +4,24 @@ extern crate rustdoc_nonreachable_impls; -// @has issue_31948_1/struct.Wobble.html -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' -// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' -// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' +//@ has issue_31948_1/struct.Wobble.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' pub use rustdoc_nonreachable_impls::hidden::Wobble; -// @has issue_31948_1/trait.Bark.html -// @has - '//h3[@class="code-header"]' 'for Foo' -// @has - '//h3[@class="code-header"]' 'for Wobble' -// @!has - '//h3[@class="code-header"]' 'for Wibble' +//@ has issue_31948_1/trait.Bark.html +//@ has - '//h3[@class="code-header"]' 'for Foo' +//@ has - '//h3[@class="code-header"]' 'for Wobble' +//@ !has - '//h3[@class="code-header"]' 'for Wibble' pub use rustdoc_nonreachable_impls::Bark; -// @has issue_31948_1/trait.Woof.html -// @has - '//h3[@class="code-header"]' 'for Foo' -// @has - '//h3[@class="code-header"]' 'for Wobble' -// @!has - '//h3[@class="code-header"]' 'for Wibble' +//@ has issue_31948_1/trait.Woof.html +//@ has - '//h3[@class="code-header"]' 'for Foo' +//@ has - '//h3[@class="code-header"]' 'for Wobble' +//@ !has - '//h3[@class="code-header"]' 'for Wibble' pub use rustdoc_nonreachable_impls::Woof; -// @!has issue_31948_1/trait.Bar.html -// @!has issue_31948_1/trait.Qux.html +//@ !has issue_31948_1/trait.Bar.html +//@ !has issue_31948_1/trait.Qux.html diff --git a/tests/rustdoc/inline_cross/issue-31948-2.rs b/tests/rustdoc/inline_cross/issue-31948-2.rs index 5019f0369b7..34b57052883 100644 --- a/tests/rustdoc/inline_cross/issue-31948-2.rs +++ b/tests/rustdoc/inline_cross/issue-31948-2.rs @@ -4,18 +4,18 @@ extern crate rustdoc_nonreachable_impls; -// @has issue_31948_2/struct.Wobble.html -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' -// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' +//@ has issue_31948_2/struct.Wobble.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' pub use rustdoc_nonreachable_impls::hidden::Wobble; -// @has issue_31948_2/trait.Qux.html -// @has - '//h3[@class="code-header"]' 'for Foo' -// @has - '//h3[@class="code-header"]' 'for Wobble' +//@ has issue_31948_2/trait.Qux.html +//@ has - '//h3[@class="code-header"]' 'for Foo' +//@ has - '//h3[@class="code-header"]' 'for Wobble' pub use rustdoc_nonreachable_impls::hidden::Qux; -// @!has issue_31948_2/trait.Bar.html -// @!has issue_31948_2/trait.Woof.html -// @!has issue_31948_2/trait.Bark.html +//@ !has issue_31948_2/trait.Bar.html +//@ !has issue_31948_2/trait.Woof.html +//@ !has issue_31948_2/trait.Bark.html diff --git a/tests/rustdoc/inline_cross/issue-31948.rs b/tests/rustdoc/inline_cross/issue-31948.rs index eaed8509520..7a43fc7b279 100644 --- a/tests/rustdoc/inline_cross/issue-31948.rs +++ b/tests/rustdoc/inline_cross/issue-31948.rs @@ -4,26 +4,26 @@ extern crate rustdoc_nonreachable_impls; -// @has issue_31948/struct.Foo.html -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' -// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' -// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' +//@ has issue_31948/struct.Foo.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bark for' +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'Woof for' +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for' +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for' pub use rustdoc_nonreachable_impls::Foo; -// @has issue_31948/trait.Bark.html -// @has - '//h3[@class="code-header"]' 'for Foo' -// @!has - '//h3[@class="code-header"]' 'for Wibble' -// @!has - '//h3[@class="code-header"]' 'for Wobble' +//@ has issue_31948/trait.Bark.html +//@ has - '//h3[@class="code-header"]' 'for Foo' +//@ !has - '//h3[@class="code-header"]' 'for Wibble' +//@ !has - '//h3[@class="code-header"]' 'for Wobble' pub use rustdoc_nonreachable_impls::Bark; -// @has issue_31948/trait.Woof.html -// @has - '//h3[@class="code-header"]' 'for Foo' -// @!has - '//h3[@class="code-header"]' 'for Wibble' -// @!has - '//h3[@class="code-header"]' 'for Wobble' +//@ has issue_31948/trait.Woof.html +//@ has - '//h3[@class="code-header"]' 'for Foo' +//@ !has - '//h3[@class="code-header"]' 'for Wibble' +//@ !has - '//h3[@class="code-header"]' 'for Wobble' pub use rustdoc_nonreachable_impls::Woof; -// @!has issue_31948/trait.Bar.html -// @!has issue_31948/trait.Qux.html -// @!has issue_31948/struct.Wibble.html -// @!has issue_31948/struct.Wobble.html +//@ !has issue_31948/trait.Bar.html +//@ !has issue_31948/trait.Qux.html +//@ !has issue_31948/struct.Wibble.html +//@ !has issue_31948/struct.Wobble.html diff --git a/tests/rustdoc/inline_cross/issue-32881.rs b/tests/rustdoc/inline_cross/issue-32881.rs index 93e868b466a..d4ebf10a1ca 100644 --- a/tests/rustdoc/inline_cross/issue-32881.rs +++ b/tests/rustdoc/inline_cross/issue-32881.rs @@ -4,8 +4,8 @@ extern crate rustdoc_trait_object_impl; -// @has issue_32881/trait.Bar.html -// @has - '//h3[@class="code-header"]' "impl<'a> dyn Bar" -// @has - '//h3[@class="code-header"]' "impl<'a> Debug for dyn Bar" +//@ has issue_32881/trait.Bar.html +//@ has - '//h3[@class="code-header"]' "impl<'a> dyn Bar" +//@ has - '//h3[@class="code-header"]' "impl<'a> Debug for dyn Bar" pub use rustdoc_trait_object_impl::Bar; diff --git a/tests/rustdoc/inline_cross/issue-33113.rs b/tests/rustdoc/inline_cross/issue-33113.rs index 807bbcbe9b8..05e87d962cb 100644 --- a/tests/rustdoc/inline_cross/issue-33113.rs +++ b/tests/rustdoc/inline_cross/issue-33113.rs @@ -4,7 +4,7 @@ extern crate bar; -// @has issue_33113/trait.Bar.html -// @has - '//h3[@class="code-header"]' "for &'a char" -// @has - '//h3[@class="code-header"]' "for Foo" +//@ has issue_33113/trait.Bar.html +//@ has - '//h3[@class="code-header"]' "for &'a char" +//@ has - '//h3[@class="code-header"]' "for Foo" pub use bar::Bar; diff --git a/tests/rustdoc/inline_cross/issue-76736-1.rs b/tests/rustdoc/inline_cross/issue-76736-1.rs index 692677a3eee..fe52702fd6f 100644 --- a/tests/rustdoc/inline_cross/issue-76736-1.rs +++ b/tests/rustdoc/inline_cross/issue-76736-1.rs @@ -6,10 +6,10 @@ extern crate issue_76736_1; extern crate issue_76736_2; -// @has foo/struct.Foo.html -// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +//@ has foo/struct.Foo.html +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' pub struct Foo; -// @has foo/struct.Bar.html -// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +//@ has foo/struct.Bar.html +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/issue-76736-2.rs b/tests/rustdoc/inline_cross/issue-76736-2.rs index d4e6a697fc8..df376ebe9a1 100644 --- a/tests/rustdoc/inline_cross/issue-76736-2.rs +++ b/tests/rustdoc/inline_cross/issue-76736-2.rs @@ -9,10 +9,10 @@ extern crate issue_76736_1; extern crate issue_76736_2; -// @has foo/struct.Foo.html -// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +//@ has foo/struct.Foo.html +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' pub struct Foo; -// @has foo/struct.Bar.html -// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +//@ has foo/struct.Bar.html +//@ !has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/issue-76736-3.rs b/tests/rustdoc/inline_cross/issue-76736-3.rs index cf75c8d0321..1bed4621c04 100644 --- a/tests/rustdoc/inline_cross/issue-76736-3.rs +++ b/tests/rustdoc/inline_cross/issue-76736-3.rs @@ -7,10 +7,10 @@ extern crate issue_76736_1; extern crate issue_76736_2; -// @has foo/struct.Foo.html -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +//@ has foo/struct.Foo.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' pub struct Foo; -// @has foo/struct.Bar.html -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +//@ has foo/struct.Bar.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/issue-76736-4.rs b/tests/rustdoc/inline_cross/issue-76736-4.rs index 297657ef9de..487e9030108 100644 --- a/tests/rustdoc/inline_cross/issue-76736-4.rs +++ b/tests/rustdoc/inline_cross/issue-76736-4.rs @@ -10,10 +10,10 @@ extern crate issue_76736_1; extern crate issue_76736_2; -// @has foo/struct.Foo.html -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +//@ has foo/struct.Foo.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' pub struct Foo; -// @has foo/struct.Bar.html -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' +//@ has foo/struct.Bar.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'MaybeResult' pub use issue_76736_2::Bar; diff --git a/tests/rustdoc/inline_cross/macro-vis.rs b/tests/rustdoc/inline_cross/macro-vis.rs index 6b811f1452a..b38748407b3 100644 --- a/tests/rustdoc/inline_cross/macro-vis.rs +++ b/tests/rustdoc/inline_cross/macro-vis.rs @@ -4,29 +4,29 @@ #[macro_use] extern crate qwop; -// @has macro_vis/macro.some_macro.html -// @has macro_vis/index.html '//a/@href' 'macro.some_macro.html' +//@ has macro_vis/macro.some_macro.html +//@ has macro_vis/index.html '//a/@href' 'macro.some_macro.html' pub use qwop::some_macro; -// @has macro_vis/macro.renamed_macro.html -// @!has - '//pre' 'some_macro' -// @has macro_vis/index.html '//a/@href' 'macro.renamed_macro.html' +//@ has macro_vis/macro.renamed_macro.html +//@ !has - '//pre' 'some_macro' +//@ has macro_vis/index.html '//a/@href' 'macro.renamed_macro.html' #[doc(inline)] pub use qwop::some_macro as renamed_macro; -// @!has macro_vis/macro.other_macro.html -// @!has macro_vis/index.html '//a/@href' 'macro.other_macro.html' -// @!has - '//code' 'pub use qwop::other_macro;' +//@ !has macro_vis/macro.other_macro.html +//@ !has macro_vis/index.html '//a/@href' 'macro.other_macro.html' +//@ !has - '//code' 'pub use qwop::other_macro;' #[doc(hidden)] pub use qwop::other_macro; -// @has macro_vis/index.html '//code' 'pub use qwop::super_macro;' -// @!has macro_vis/macro.super_macro.html +//@ has macro_vis/index.html '//code' 'pub use qwop::super_macro;' +//@ !has macro_vis/macro.super_macro.html #[doc(no_inline)] pub use qwop::super_macro; -// @has macro_vis/macro.this_is_dope.html -// @has macro_vis/index.html '//a/@href' 'macro.this_is_dope.html' +//@ has macro_vis/macro.this_is_dope.html +//@ has macro_vis/index.html '//a/@href' 'macro.this_is_dope.html' /// What it says on the tin. #[macro_export] macro_rules! this_is_dope { diff --git a/tests/rustdoc/inline_cross/macros.rs b/tests/rustdoc/inline_cross/macros.rs index c711216d2b5..aab7a3650b1 100644 --- a/tests/rustdoc/inline_cross/macros.rs +++ b/tests/rustdoc/inline_cross/macros.rs @@ -6,14 +6,14 @@ extern crate macros; -// @has foo/index.html '//*[@class="item-name"]/span[@class="stab deprecated"]' \ +//@ has foo/index.html '//*[@class="item-name"]/span[@class="stab deprecated"]' \ // Deprecated -// @has - '//*[@class="item-name"]/span[@class="stab unstable"]' \ +//@ has - '//*[@class="item-name"]/span[@class="stab unstable"]' \ // Experimental -// @has foo/macro.my_macro.html -// @has - '//*[@class="docblock"]' 'docs for my_macro' -// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text' -// @has - '//*[@class="stab unstable"]' 'macro_test' -// @has - '//a/@href' '../src/macros/macros.rs.html#8' +//@ has foo/macro.my_macro.html +//@ has - '//*[@class="docblock"]' 'docs for my_macro' +//@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text' +//@ has - '//*[@class="stab unstable"]' 'macro_test' +//@ has - '//a/@href' '../src/macros/macros.rs.html#8' pub use macros::my_macro; diff --git a/tests/rustdoc/inline_cross/non_lifetime_binders.rs b/tests/rustdoc/inline_cross/non_lifetime_binders.rs index edc48c88d9c..95723a61ce7 100644 --- a/tests/rustdoc/inline_cross/non_lifetime_binders.rs +++ b/tests/rustdoc/inline_cross/non_lifetime_binders.rs @@ -2,12 +2,12 @@ //@ edition: 2021 #![crate_name = "user"] -// @has user/fn.f.html -// @has - '//pre[@class="rust item-decl"]' "f(_: impl for Trait)" +//@ has user/fn.f.html +//@ has - '//pre[@class="rust item-decl"]' "f(_: impl for Trait)" pub use non_lifetime_binders::f; -// @has user/fn.g.html -// @has - '//pre[@class="rust item-decl"]' "g(_: T)\ +//@ has user/fn.g.html +//@ has - '//pre[@class="rust item-decl"]' "g(_: T)\ // where \ // T: for Trait" pub use non_lifetime_binders::g; diff --git a/tests/rustdoc/inline_cross/proc_macro.rs b/tests/rustdoc/inline_cross/proc_macro.rs index 4d3b0d554ab..de1a4b82cc4 100644 --- a/tests/rustdoc/inline_cross/proc_macro.rs +++ b/tests/rustdoc/inline_cross/proc_macro.rs @@ -3,34 +3,34 @@ extern crate some_macros; -// @has proc_macro/index.html -// @has - '//a/@href' 'macro.some_proc_macro.html' -// @has - '//a/@href' 'attr.some_proc_attr.html' -// @has - '//a/@href' 'derive.SomeDerive.html' -// @has proc_macro/macro.some_proc_macro.html -// @has proc_macro/attr.some_proc_attr.html -// @has proc_macro/derive.SomeDerive.html +//@ has proc_macro/index.html +//@ has - '//a/@href' 'macro.some_proc_macro.html' +//@ has - '//a/@href' 'attr.some_proc_attr.html' +//@ has - '//a/@href' 'derive.SomeDerive.html' +//@ has proc_macro/macro.some_proc_macro.html +//@ has proc_macro/attr.some_proc_attr.html +//@ has proc_macro/derive.SomeDerive.html -// @has proc_macro/macro.some_proc_macro.html -// @hasraw - 'a proc-macro that swallows its input and does nothing.' +//@ has proc_macro/macro.some_proc_macro.html +//@ hasraw - 'a proc-macro that swallows its input and does nothing.' pub use some_macros::some_proc_macro; -// @has proc_macro/macro.reexported_macro.html -// @hasraw - 'Doc comment from the original crate' +//@ has proc_macro/macro.reexported_macro.html +//@ hasraw - 'Doc comment from the original crate' pub use some_macros::reexported_macro; -// @has proc_macro/attr.some_proc_attr.html -// @hasraw - 'a proc-macro attribute that passes its item through verbatim.' +//@ has proc_macro/attr.some_proc_attr.html +//@ hasraw - 'a proc-macro attribute that passes its item through verbatim.' pub use some_macros::some_proc_attr; -// @has proc_macro/derive.SomeDerive.html -// @hasraw - 'a derive attribute that adds nothing to its input.' +//@ has proc_macro/derive.SomeDerive.html +//@ hasraw - 'a derive attribute that adds nothing to its input.' pub use some_macros::SomeDerive; -// @has proc_macro/attr.first_attr.html -// @hasraw - 'Generated doc comment' +//@ has proc_macro/attr.first_attr.html +//@ hasraw - 'Generated doc comment' pub use some_macros::first_attr; -// @has proc_macro/attr.second_attr.html -// @hasraw - 'Generated doc comment' +//@ has proc_macro/attr.second_attr.html +//@ hasraw - 'Generated doc comment' pub use some_macros::second_attr; diff --git a/tests/rustdoc/inline_cross/qpath-self-85454.rs b/tests/rustdoc/inline_cross/qpath-self-85454.rs index de806db7709..4751b7b1db4 100644 --- a/tests/rustdoc/inline_cross/qpath-self-85454.rs +++ b/tests/rustdoc/inline_cross/qpath-self-85454.rs @@ -5,8 +5,8 @@ extern crate issue_85454; -// @has foo/trait.FromResidual.html -// @has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual::Residual> { // Required method fn from_residual(residual: R) -> Self; }' +//@ has foo/trait.FromResidual.html +//@ has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual::Residual> { // Required method fn from_residual(residual: R) -> Self; }' pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; } @@ -24,7 +24,7 @@ pub enum ControlFlow { } pub mod reexport { - // @has foo/reexport/trait.FromResidual.html - // @has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual::Residual> { // Required method fn from_residual(residual: R) -> Self; }' + //@ has foo/reexport/trait.FromResidual.html + //@ has - '//pre[@class="rust item-decl"]' 'pub trait FromResidual::Residual> { // Required method fn from_residual(residual: R) -> Self; }' pub use issue_85454::*; } diff --git a/tests/rustdoc/inline_cross/reexport-with-anonymous-lifetime-98697.rs b/tests/rustdoc/inline_cross/reexport-with-anonymous-lifetime-98697.rs index fe6e5a39c81..bb4ced085c3 100644 --- a/tests/rustdoc/inline_cross/reexport-with-anonymous-lifetime-98697.rs +++ b/tests/rustdoc/inline_cross/reexport-with-anonymous-lifetime-98697.rs @@ -9,10 +9,10 @@ extern crate reexport_with_anonymous_lifetime_98697; -// @has foo/fn.repro.html '//pre[@class="rust item-decl"]/code' 'fn repro()where F: Fn(&str)' -// @!has foo/fn.repro.html '//pre[@class="rust item-decl"]/code' 'for<' +//@ has foo/fn.repro.html '//pre[@class="rust item-decl"]/code' 'fn repro()where F: Fn(&str)' +//@ !has foo/fn.repro.html '//pre[@class="rust item-decl"]/code' 'for<' pub use reexport_with_anonymous_lifetime_98697::repro; -// @has foo/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl MyTrait<&Extra> for Extra' -// @!has foo/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl<' +//@ has foo/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl MyTrait<&Extra> for Extra' +//@ !has foo/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl<' pub use reexport_with_anonymous_lifetime_98697::Extra; diff --git a/tests/rustdoc/inline_cross/renamed-via-module.rs b/tests/rustdoc/inline_cross/renamed-via-module.rs index 1f6a9cff8ce..bdaf2cf1f62 100644 --- a/tests/rustdoc/inline_cross/renamed-via-module.rs +++ b/tests/rustdoc/inline_cross/renamed-via-module.rs @@ -6,19 +6,19 @@ extern crate foo; -// @has foo/iter/index.html -// @has - '//a/[@href="struct.DeprecatedStepBy.html"]' "DeprecatedStepBy" -// @has - '//a/[@href="struct.StepBy.html"]' "StepBy" -// @has foo/iter/struct.DeprecatedStepBy.html -// @has - '//h1' "Struct foo::iter::DeprecatedStepBy" -// @has foo/iter/struct.StepBy.html -// @has - '//h1' "Struct foo::iter::StepBy" +//@ has foo/iter/index.html +//@ has - '//a/[@href="struct.DeprecatedStepBy.html"]' "DeprecatedStepBy" +//@ has - '//a/[@href="struct.StepBy.html"]' "StepBy" +//@ has foo/iter/struct.DeprecatedStepBy.html +//@ has - '//h1' "Struct foo::iter::DeprecatedStepBy" +//@ has foo/iter/struct.StepBy.html +//@ has - '//h1' "Struct foo::iter::StepBy" -// @has bar/iter/index.html -// @has - '//a/[@href="struct.DeprecatedStepBy.html"]' "DeprecatedStepBy" -// @has - '//a/[@href="struct.StepBy.html"]' "StepBy" -// @has bar/iter/struct.DeprecatedStepBy.html -// @has - '//h1' "Struct bar::iter::DeprecatedStepBy" -// @has bar/iter/struct.StepBy.html -// @has - '//h1' "Struct bar::iter::StepBy" +//@ has bar/iter/index.html +//@ has - '//a/[@href="struct.DeprecatedStepBy.html"]' "DeprecatedStepBy" +//@ has - '//a/[@href="struct.StepBy.html"]' "StepBy" +//@ has bar/iter/struct.DeprecatedStepBy.html +//@ has - '//h1' "Struct bar::iter::DeprecatedStepBy" +//@ has bar/iter/struct.StepBy.html +//@ has - '//h1' "Struct bar::iter::StepBy" pub use foo::iter; diff --git a/tests/rustdoc/inline_cross/repr.rs b/tests/rustdoc/inline_cross/repr.rs index 1d63bd1d7cb..d13e560b8d7 100644 --- a/tests/rustdoc/inline_cross/repr.rs +++ b/tests/rustdoc/inline_cross/repr.rs @@ -7,34 +7,34 @@ extern crate repr; -// @has 'foo/struct.ReprC.html' -// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(C, align(8))]' +//@ has 'foo/struct.ReprC.html' +//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(C, align(8))]' pub use repr::ReprC; -// @has 'foo/struct.ReprSimd.html' -// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(simd, packed(2))]' +//@ has 'foo/struct.ReprSimd.html' +//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(simd, packed(2))]' pub use repr::ReprSimd; -// @has 'foo/struct.ReprTransparent.html' -// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' +//@ has 'foo/struct.ReprTransparent.html' +//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' pub use repr::ReprTransparent; -// @has 'foo/enum.ReprIsize.html' -// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(isize)]' +//@ has 'foo/enum.ReprIsize.html' +//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(isize)]' pub use repr::ReprIsize; -// @has 'foo/enum.ReprU8.html' -// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(u8)]' +//@ has 'foo/enum.ReprU8.html' +//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(u8)]' pub use repr::ReprU8; // Regression test for . // Check that we show `#[repr(transparent)]` iff the non-1-ZST field is public or at least one // field is public in case all fields are 1-ZST fields. -// @has 'foo/struct.ReprTransparentPrivField.html' -// @!has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' +//@ has 'foo/struct.ReprTransparentPrivField.html' +//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' pub use repr::ReprTransparentPrivField; -// @has 'foo/struct.ReprTransparentPriv1ZstFields.html' -// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' +//@ has 'foo/struct.ReprTransparentPriv1ZstFields.html' +//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' pub use repr::ReprTransparentPriv1ZstFields; -// @has 'foo/struct.ReprTransparentPrivFieldPub1ZstFields.html' -// @!has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' +//@ has 'foo/struct.ReprTransparentPrivFieldPub1ZstFields.html' +//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' pub use repr::ReprTransparentPrivFieldPub1ZstFields; diff --git a/tests/rustdoc/inline_cross/ret-pos-impl-trait-in-trait.rs b/tests/rustdoc/inline_cross/ret-pos-impl-trait-in-trait.rs index 1292e7c74ed..fba39ca8358 100644 --- a/tests/rustdoc/inline_cross/ret-pos-impl-trait-in-trait.rs +++ b/tests/rustdoc/inline_cross/ret-pos-impl-trait-in-trait.rs @@ -7,29 +7,29 @@ // their desugaring. We count the number of associated items and ensure that it is exactly one. // This is more robust than checking for the absence of the associated type. -// @has user/trait.Trait.html -// @has - '//*[@id="method.create"]' 'fn create() -> impl Iterator' +//@ has user/trait.Trait.html +//@ has - '//*[@id="method.create"]' 'fn create() -> impl Iterator' // The class "method" is used for all three kinds of associated items at the time of writing. -// @count - '//*[@id="main-content"]//section[@class="method"]' 1 +//@ count - '//*[@id="main-content"]//section[@class="method"]' 1 pub use rpitit::Trait; -// @has user/struct.Basic.html -// @has - '//*[@id="method.create"]' 'fn create() -> impl Iterator' -// @count - '//*[@id="trait-implementations-list"]//*[@class="impl-items"]' 1 +//@ has user/struct.Basic.html +//@ has - '//*[@id="method.create"]' 'fn create() -> impl Iterator' +//@ count - '//*[@id="trait-implementations-list"]//*[@class="impl-items"]' 1 pub use rpitit::Basic; -// @has user/struct.Intermediate.html -// @has - '//*[@id="method.create"]' 'fn create() -> Range' -// @count - '//*[@id="trait-implementations-list"]//*[@class="impl-items"]' 1 +//@ has user/struct.Intermediate.html +//@ has - '//*[@id="method.create"]' 'fn create() -> Range' +//@ count - '//*[@id="trait-implementations-list"]//*[@class="impl-items"]' 1 pub use rpitit::Intermediate; -// @has user/struct.Advanced.html -// @has - '//*[@id="method.create"]' 'fn create() -> impl Iterator' -// @count - '//*[@id="trait-implementations-list"]//*[@class="impl-items"]' 1 +//@ has user/struct.Advanced.html +//@ has - '//*[@id="method.create"]' 'fn create() -> impl Iterator' +//@ count - '//*[@id="trait-implementations-list"]//*[@class="impl-items"]' 1 pub use rpitit::Advanced; // Regression test for issue #113929: -// @has user/trait.Def.html -// @has - '//*[@id="method.def"]' 'fn def() -> impl Default' +//@ has user/trait.Def.html +//@ has - '//*[@id="method.def"]' 'fn def() -> impl Default' pub use rpitit::Def; diff --git a/tests/rustdoc/inline_cross/sugar-closure-crate-21801.rs b/tests/rustdoc/inline_cross/sugar-closure-crate-21801.rs index a00dcaf409b..0cd400c03ec 100644 --- a/tests/rustdoc/inline_cross/sugar-closure-crate-21801.rs +++ b/tests/rustdoc/inline_cross/sugar-closure-crate-21801.rs @@ -6,7 +6,7 @@ extern crate issue_21801; -// @has issue_21801/struct.Foo.html -// @has - '//*[@id="method.new"]' \ +//@ has issue_21801/struct.Foo.html +//@ has - '//*[@id="method.new"]' \ // 'fn new(f: F) -> Foowhere F: FnMut() -> i32' pub use issue_21801::Foo; diff --git a/tests/rustdoc/inline_cross/trait-vis.rs b/tests/rustdoc/inline_cross/trait-vis.rs index fc992ab3110..1fae6305b04 100644 --- a/tests/rustdoc/inline_cross/trait-vis.rs +++ b/tests/rustdoc/inline_cross/trait-vis.rs @@ -2,6 +2,6 @@ extern crate inner; -// @has trait_vis/struct.SomeStruct.html -// @has - '//h3[@class="code-header"]' 'impl Clone for SomeStruct' +//@ has trait_vis/struct.SomeStruct.html +//@ has - '//h3[@class="code-header"]' 'impl Clone for SomeStruct' pub use inner::SomeStruct; diff --git a/tests/rustdoc/inline_cross/use_crate.rs b/tests/rustdoc/inline_cross/use_crate.rs index 38cbcfa6b84..fdbc41c0bb0 100644 --- a/tests/rustdoc/inline_cross/use_crate.rs +++ b/tests/rustdoc/inline_cross/use_crate.rs @@ -10,18 +10,18 @@ #![crate_name = "local"] -// @!has-dir local/use_crate -// @has local/index.html -// @has - '//code' 'pub use use_crate' +//@ !has-dir local/use_crate +//@ has local/index.html +//@ has - '//code' 'pub use use_crate' pub use use_crate; -// @has-dir local/asdf -// @has local/asdf/index.html -// @has local/index.html '//a/@href' 'asdf/index.html' +//@ has-dir local/asdf +//@ has local/asdf/index.html +//@ has local/index.html '//a/@href' 'asdf/index.html' pub use use_crate::asdf; -// @has-dir local/use_crate_2 -// @has local/use_crate_2/index.html -// @has local/index.html '//a/@href' 'use_crate_2/index.html' +//@ has-dir local/use_crate_2 +//@ has local/use_crate_2/index.html +//@ has local/index.html '//a/@href' 'use_crate_2/index.html' #[doc(inline)] pub use use_crate_2; diff --git a/tests/rustdoc/inline_local/blanket-impl-reexported-trait-94183.rs b/tests/rustdoc/inline_local/blanket-impl-reexported-trait-94183.rs index 343e030da9e..66d313a4506 100644 --- a/tests/rustdoc/inline_local/blanket-impl-reexported-trait-94183.rs +++ b/tests/rustdoc/inline_local/blanket-impl-reexported-trait-94183.rs @@ -5,28 +5,28 @@ // https://github.com/rust-lang/rust/issues/94183 #![crate_name = "foo"] -// @has 'foo/struct.S.html' +//@ has 'foo/struct.S.html' mod actual_sub { pub trait Actual {} pub trait Another {} // `Another` is publicly re-exported so it should appear in the blanket impl list. - // @has - '//*[@id="blanket-implementations-list"]//*[@class="code-header"]' 'impl Another for T' + //@ has - '//*[@id="blanket-implementations-list"]//*[@class="code-header"]' 'impl Another for T' impl Another for T {} trait Foo {} // `Foo` is not publicly re-exported nor reachable so it shouldn't appear in the // blanket impl list. - // @!has - '//*[@id="blanket-implementations-list"]//*[@class="code-header"]' 'impl Foo for T' + //@ !has - '//*[@id="blanket-implementations-list"]//*[@class="code-header"]' 'impl Foo for T' impl Foo for T {} } pub use actual_sub::{Actual, Another}; // `Actual` is publicly re-exported so it should appear in the blanket impl list. -// @has - '//*[@id="blanket-implementations-list"]//*[@class="code-header"]' 'impl Actual for T' +//@ has - '//*[@id="blanket-implementations-list"]//*[@class="code-header"]' 'impl Actual for T' impl Actual for T {} pub struct S; diff --git a/tests/rustdoc/inline_local/enum-variant-reexport-46766.rs b/tests/rustdoc/inline_local/enum-variant-reexport-46766.rs index ea6b7bac4c7..8a41f9d1fc5 100644 --- a/tests/rustdoc/inline_local/enum-variant-reexport-46766.rs +++ b/tests/rustdoc/inline_local/enum-variant-reexport-46766.rs @@ -4,4 +4,4 @@ pub enum Enum{Variant} pub use self::Enum::Variant; -// @!has foo/index.html '//a/@href' './Enum/index.html' +//@ !has foo/index.html '//a/@href' './Enum/index.html' diff --git a/tests/rustdoc/inline_local/glob-extern-document-private-items.rs b/tests/rustdoc/inline_local/glob-extern-document-private-items.rs index 9a11f88c81a..f58474bf5f9 100644 --- a/tests/rustdoc/inline_local/glob-extern-document-private-items.rs +++ b/tests/rustdoc/inline_local/glob-extern-document-private-items.rs @@ -11,15 +11,15 @@ mod mod1 { pub use mod1::*; -// @has foo/index.html -// @hasraw - "mod1" -// @hasraw - "public_fn" -// @!hasraw - "private_fn" -// @has foo/fn.public_fn.html -// @!has foo/fn.private_fn.html +//@ has foo/index.html +//@ hasraw - "mod1" +//@ hasraw - "public_fn" +//@ !hasraw - "private_fn" +//@ has foo/fn.public_fn.html +//@ !has foo/fn.private_fn.html -// @has foo/mod1/index.html -// @hasraw - "public_fn" -// @hasraw - "private_fn" -// @has foo/mod1/fn.public_fn.html -// @has foo/mod1/fn.private_fn.html +//@ has foo/mod1/index.html +//@ hasraw - "public_fn" +//@ hasraw - "private_fn" +//@ has foo/mod1/fn.public_fn.html +//@ has foo/mod1/fn.private_fn.html diff --git a/tests/rustdoc/inline_local/glob-extern.rs b/tests/rustdoc/inline_local/glob-extern.rs index c592a4db19d..5e7a631ad18 100644 --- a/tests/rustdoc/inline_local/glob-extern.rs +++ b/tests/rustdoc/inline_local/glob-extern.rs @@ -9,13 +9,13 @@ mod mod1 { pub use mod1::*; -// @has foo/index.html -// @!hasraw - "mod1" -// @hasraw - "public_fn" -// @!hasraw - "private_fn" -// @has foo/fn.public_fn.html -// @!has foo/fn.private_fn.html +//@ has foo/index.html +//@ !hasraw - "mod1" +//@ hasraw - "public_fn" +//@ !hasraw - "private_fn" +//@ has foo/fn.public_fn.html +//@ !has foo/fn.private_fn.html -// @!has foo/mod1/index.html -// @has foo/mod1/fn.public_fn.html -// @!has foo/mod1/fn.private_fn.html +//@ !has foo/mod1/index.html +//@ has foo/mod1/fn.public_fn.html +//@ !has foo/mod1/fn.private_fn.html diff --git a/tests/rustdoc/inline_local/glob-private-document-private-items.rs b/tests/rustdoc/inline_local/glob-private-document-private-items.rs index 4ad217d2270..4ad36da843f 100644 --- a/tests/rustdoc/inline_local/glob-private-document-private-items.rs +++ b/tests/rustdoc/inline_local/glob-private-document-private-items.rs @@ -14,35 +14,35 @@ mod mod1 { } pub use mod1::*; -// @has foo/index.html -// @hasraw - "mod1" -// @hasraw - "Mod1Public" -// @!hasraw - "Mod1Private" -// @!hasraw - "mod2" -// @hasraw - "Mod2Public" -// @!hasraw - "Mod2Private" -// @has foo/struct.Mod1Public.html -// @!has foo/struct.Mod1Private.html -// @has foo/struct.Mod2Public.html -// @!has foo/struct.Mod2Private.html +//@ has foo/index.html +//@ hasraw - "mod1" +//@ hasraw - "Mod1Public" +//@ !hasraw - "Mod1Private" +//@ !hasraw - "mod2" +//@ hasraw - "Mod2Public" +//@ !hasraw - "Mod2Private" +//@ has foo/struct.Mod1Public.html +//@ !has foo/struct.Mod1Private.html +//@ has foo/struct.Mod2Public.html +//@ !has foo/struct.Mod2Private.html -// @has foo/mod1/index.html -// @hasraw - "mod2" -// @hasraw - "Mod1Public" -// @hasraw - "Mod1Private" -// @!hasraw - "Mod2Public" -// @!hasraw - "Mod2Private" -// @has foo/mod1/struct.Mod1Public.html -// @has foo/mod1/struct.Mod1Private.html -// @!has foo/mod1/struct.Mod2Public.html -// @!has foo/mod1/struct.Mod2Private.html +//@ has foo/mod1/index.html +//@ hasraw - "mod2" +//@ hasraw - "Mod1Public" +//@ hasraw - "Mod1Private" +//@ !hasraw - "Mod2Public" +//@ !hasraw - "Mod2Private" +//@ has foo/mod1/struct.Mod1Public.html +//@ has foo/mod1/struct.Mod1Private.html +//@ !has foo/mod1/struct.Mod2Public.html +//@ !has foo/mod1/struct.Mod2Private.html -// @has foo/mod1/mod2/index.html -// @hasraw - "Mod2Public" -// @hasraw - "Mod2Private" -// @has foo/mod1/mod2/struct.Mod2Public.html -// @has foo/mod1/mod2/struct.Mod2Private.html +//@ has foo/mod1/mod2/index.html +//@ hasraw - "Mod2Public" +//@ hasraw - "Mod2Private" +//@ has foo/mod1/mod2/struct.Mod2Public.html +//@ has foo/mod1/mod2/struct.Mod2Private.html -// @!has foo/mod2/index.html -// @!has foo/mod2/struct.Mod2Public.html -// @!has foo/mod2/struct.Mod2Private.html +//@ !has foo/mod2/index.html +//@ !has foo/mod2/struct.Mod2Public.html +//@ !has foo/mod2/struct.Mod2Private.html diff --git a/tests/rustdoc/inline_local/glob-private.rs b/tests/rustdoc/inline_local/glob-private.rs index 303f1d61048..d6499d27a25 100644 --- a/tests/rustdoc/inline_local/glob-private.rs +++ b/tests/rustdoc/inline_local/glob-private.rs @@ -12,31 +12,31 @@ mod mod1 { } pub use mod1::*; -// @has foo/index.html -// @!hasraw - "mod1" -// @hasraw - "Mod1Public" -// @!hasraw - "Mod1Private" -// @!hasraw - "mod2" -// @hasraw - "Mod2Public" -// @!hasraw - "Mod2Private" -// @has foo/struct.Mod1Public.html -// @!has foo/struct.Mod1Private.html -// @has foo/struct.Mod2Public.html -// @!has foo/struct.Mod2Private.html +//@ has foo/index.html +//@ !hasraw - "mod1" +//@ hasraw - "Mod1Public" +//@ !hasraw - "Mod1Private" +//@ !hasraw - "mod2" +//@ hasraw - "Mod2Public" +//@ !hasraw - "Mod2Private" +//@ has foo/struct.Mod1Public.html +//@ !has foo/struct.Mod1Private.html +//@ has foo/struct.Mod2Public.html +//@ !has foo/struct.Mod2Private.html -// @has-dir foo/mod1 -// @!has foo/mod1/index.html -// @has foo/mod1/struct.Mod1Public.html -// @!has foo/mod1/struct.Mod1Private.html -// @!has foo/mod1/struct.Mod2Public.html -// @!has foo/mod1/struct.Mod2Private.html +//@ has-dir foo/mod1 +//@ !has foo/mod1/index.html +//@ has foo/mod1/struct.Mod1Public.html +//@ !has foo/mod1/struct.Mod1Private.html +//@ !has foo/mod1/struct.Mod2Public.html +//@ !has foo/mod1/struct.Mod2Private.html -// @has-dir foo/mod1/mod2 -// @!has foo/mod1/mod2/index.html -// @has foo/mod1/mod2/struct.Mod2Public.html -// @!has foo/mod1/mod2/struct.Mod2Private.html +//@ has-dir foo/mod1/mod2 +//@ !has foo/mod1/mod2/index.html +//@ has foo/mod1/mod2/struct.Mod2Public.html +//@ !has foo/mod1/mod2/struct.Mod2Private.html -// @!has-dir foo/mod2 -// @!has foo/mod2/index.html -// @!has foo/mod2/struct.Mod2Public.html -// @!has foo/mod2/struct.Mod2Private.html +//@ !has-dir foo/mod2 +//@ !has foo/mod2/index.html +//@ !has foo/mod2/struct.Mod2Public.html +//@ !has foo/mod2/struct.Mod2Private.html diff --git a/tests/rustdoc/inline_local/hidden-use.rs b/tests/rustdoc/inline_local/hidden-use.rs index de512fb26e6..35bce2932f9 100644 --- a/tests/rustdoc/inline_local/hidden-use.rs +++ b/tests/rustdoc/inline_local/hidden-use.rs @@ -2,9 +2,9 @@ mod private { pub struct Foo {} } -// @has hidden_use/index.html -// @!hasraw - 'private' -// @!hasraw - 'Foo' -// @!has hidden_use/struct.Foo.html +//@ has hidden_use/index.html +//@ !hasraw - 'private' +//@ !hasraw - 'Foo' +//@ !has hidden_use/struct.Foo.html #[doc(hidden)] pub use private::Foo; diff --git a/tests/rustdoc/inline_local/issue-28537.rs b/tests/rustdoc/inline_local/issue-28537.rs index da9cc4c940d..d5ba94d2e6c 100644 --- a/tests/rustdoc/inline_local/issue-28537.rs +++ b/tests/rustdoc/inline_local/issue-28537.rs @@ -10,8 +10,8 @@ mod bar { } } -// @has issue_28537/struct.Foo.html +//@ has issue_28537/struct.Foo.html pub use foo::Foo; -// @has issue_28537/struct.Bar.html +//@ has issue_28537/struct.Bar.html pub use self::bar::Bar; diff --git a/tests/rustdoc/inline_local/issue-32343.rs b/tests/rustdoc/inline_local/issue-32343.rs index 5620ae0dced..2ec123fdc5c 100644 --- a/tests/rustdoc/inline_local/issue-32343.rs +++ b/tests/rustdoc/inline_local/issue-32343.rs @@ -1,14 +1,14 @@ -// @!has issue_32343/struct.Foo.html -// @has issue_32343/index.html -// @has - '//code' 'pub use foo::Foo' -// @!has - '//code/a' 'Foo' +//@ !has issue_32343/struct.Foo.html +//@ has issue_32343/index.html +//@ has - '//code' 'pub use foo::Foo' +//@ !has - '//code/a' 'Foo' #[doc(no_inline)] pub use foo::Foo; -// @!has issue_32343/struct.Bar.html -// @has issue_32343/index.html -// @has - '//code' 'pub use foo::Bar' -// @has - '//code/a' 'Bar' +//@ !has issue_32343/struct.Bar.html +//@ has issue_32343/index.html +//@ has - '//code' 'pub use foo::Bar' +//@ has - '//code/a' 'Bar' #[doc(no_inline)] pub use foo::Bar; @@ -18,6 +18,6 @@ mod foo { } pub mod bar { - // @has issue_32343/bar/struct.Bar.html + //@ has issue_32343/bar/struct.Bar.html pub use ::foo::Bar; } diff --git a/tests/rustdoc/inline_local/macro_by_example.rs b/tests/rustdoc/inline_local/macro_by_example.rs index 5c33c0037e4..584a149968e 100644 --- a/tests/rustdoc/inline_local/macro_by_example.rs +++ b/tests/rustdoc/inline_local/macro_by_example.rs @@ -5,13 +5,13 @@ macro_rules! foo { ($($tt:tt)*) => {} } -// @has macro_by_example/macros/index.html +//@ has macro_by_example/macros/index.html pub mod macros { - // @!hasraw - 'pub use foo as bar;' - // @has macro_by_example/macros/macro.bar.html - // @has - '//*[@class="docblock"]' 'docs for foo' - // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text' - // @has - '//a/@href' 'macro_by_example.rs.html#4-6' + //@ !hasraw - 'pub use foo as bar;' + //@ has macro_by_example/macros/macro.bar.html + //@ has - '//*[@class="docblock"]' 'docs for foo' + //@ has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text' + //@ has - '//a/@href' 'macro_by_example.rs.html#4-6' #[doc(inline)] pub use foo as bar; } diff --git a/tests/rustdoc/inline_local/please_inline.rs b/tests/rustdoc/inline_local/please_inline.rs index e4429ef33a9..ad7a30012a8 100644 --- a/tests/rustdoc/inline_local/please_inline.rs +++ b/tests/rustdoc/inline_local/please_inline.rs @@ -2,18 +2,18 @@ pub mod foo { pub struct Foo; } -// @has please_inline/a/index.html +//@ has please_inline/a/index.html pub mod a { - // @!hasraw - 'pub use foo::' - // @has please_inline/a/struct.Foo.html + //@ !hasraw - 'pub use foo::' + //@ has please_inline/a/struct.Foo.html #[doc(inline)] pub use foo::Foo; } -// @has please_inline/b/index.html +//@ has please_inline/b/index.html pub mod b { - // @hasraw - 'pub use foo::' - // @!has please_inline/b/struct.Foo.html + //@ hasraw - 'pub use foo::' + //@ !has please_inline/b/struct.Foo.html #[feature(inline)] pub use foo::Foo; } diff --git a/tests/rustdoc/inline_local/private-reexport-in-public-api-81141-2.rs b/tests/rustdoc/inline_local/private-reexport-in-public-api-81141-2.rs index c066f54b32b..9dcdc6a0f34 100644 --- a/tests/rustdoc/inline_local/private-reexport-in-public-api-81141-2.rs +++ b/tests/rustdoc/inline_local/private-reexport-in-public-api-81141-2.rs @@ -8,7 +8,7 @@ use external::Public as Private; pub mod external { pub struct Public; - // @has 'foo/external/fn.make.html' - // @has - '//*[@class="rust item-decl"]/code' 'pub fn make() -> Public' + //@ has 'foo/external/fn.make.html' + //@ has - '//*[@class="rust item-decl"]/code' 'pub fn make() -> Public' pub fn make() -> ::Private { super::Private } } diff --git a/tests/rustdoc/inline_local/private-reexport-in-public-api-81141.rs b/tests/rustdoc/inline_local/private-reexport-in-public-api-81141.rs index d695ed7fbfa..55d95c32ce2 100644 --- a/tests/rustdoc/inline_local/private-reexport-in-public-api-81141.rs +++ b/tests/rustdoc/inline_local/private-reexport-in-public-api-81141.rs @@ -16,57 +16,57 @@ mod bar { pub use self::Bar as Inner; } -// @has 'foo/fn.bar.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar() -> Bar' +//@ has 'foo/fn.bar.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar() -> Bar' pub fn bar() -> Alias { Alias } -// @has 'foo/fn.bar2.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar2() -> Whatever' +//@ has 'foo/fn.bar2.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar2() -> Whatever' pub fn bar2() -> Whatever3 { Whatever } -// @has 'foo/fn.bar3.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar3() -> Whatever4' +//@ has 'foo/fn.bar3.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar3() -> Whatever4' pub fn bar3() -> Whatever4 { Whatever } -// @has 'foo/fn.bar4.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar4() -> Bar' +//@ has 'foo/fn.bar4.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar4() -> Bar' pub fn bar4() -> crate::Alias { Alias } -// @has 'foo/fn.bar5.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar5() -> Whatever' +//@ has 'foo/fn.bar5.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar5() -> Whatever' pub fn bar5() -> crate::Whatever3 { Whatever } -// @has 'foo/fn.bar6.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar6() -> Whatever4' +//@ has 'foo/fn.bar6.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar6() -> Whatever4' pub fn bar6() -> crate::Whatever4 { Whatever } -// @has 'foo/fn.bar7.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar7() -> Bar' +//@ has 'foo/fn.bar7.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar7() -> Bar' pub fn bar7() -> self::Alias { Alias } -// @has 'foo/fn.bar8.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar8() -> Whatever' +//@ has 'foo/fn.bar8.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar8() -> Whatever' pub fn bar8() -> self::Whatever3 { Whatever } -// @has 'foo/fn.bar9.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar9() -> Whatever4' +//@ has 'foo/fn.bar9.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar9() -> Whatever4' pub fn bar9() -> self::Whatever4 { Whatever } @@ -78,38 +78,38 @@ mod nested { pub(crate) use crate::nested as nested2; } -// @has 'foo/fn.bar10.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar10() -> Bar' +//@ has 'foo/fn.bar10.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar10() -> Bar' pub fn bar10() -> nested::Alias { Alias } -// @has 'foo/fn.bar11.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar11() -> Whatever' +//@ has 'foo/fn.bar11.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar11() -> Whatever' pub fn bar11() -> nested::Whatever3 { Whatever } -// @has 'foo/fn.bar12.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar12() -> Whatever4' +//@ has 'foo/fn.bar12.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar12() -> Whatever4' pub fn bar12() -> nested::Whatever4 { Whatever } -// @has 'foo/fn.bar13.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar13() -> Bar' +//@ has 'foo/fn.bar13.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar13() -> Bar' pub fn bar13() -> nested::nested2::Alias { Alias } -// @has 'foo/fn.bar14.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar14() -> Whatever' +//@ has 'foo/fn.bar14.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar14() -> Whatever' pub fn bar14() -> nested::nested2::Whatever3 { Whatever } -// @has 'foo/fn.bar15.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar15() -> Whatever4' +//@ has 'foo/fn.bar15.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar15() -> Whatever4' pub fn bar15() -> nested::nested2::Whatever4 { Whatever } @@ -119,7 +119,7 @@ use external::Public as Private; pub mod external { pub struct Public; - // @has 'foo/external/fn.make.html' - // @has - '//*[@class="rust item-decl"]/code' 'pub fn make() -> Public' + //@ has 'foo/external/fn.make.html' + //@ has - '//*[@class="rust item-decl"]/code' 'pub fn make() -> Public' pub fn make() -> super::Private { super::Private } } diff --git a/tests/rustdoc/inline_local/private-reexport-in-public-api-generics-81141.rs b/tests/rustdoc/inline_local/private-reexport-in-public-api-generics-81141.rs index 1c86c769a12..a0b637f0992 100644 --- a/tests/rustdoc/inline_local/private-reexport-in-public-api-generics-81141.rs +++ b/tests/rustdoc/inline_local/private-reexport-in-public-api-generics-81141.rs @@ -7,8 +7,8 @@ pub mod bar { pub struct Foo<'a, T>(&'a T); } -// @has "foo/fn.foo.html" -// @has - '//*[@class="rust item-decl"]/code' "pub fn foo<'a, T>(f: Foo<'a, T>) -> Foo<'a, usize>" +//@ has "foo/fn.foo.html" +//@ has - '//*[@class="rust item-decl"]/code' "pub fn foo<'a, T>(f: Foo<'a, T>) -> Foo<'a, usize>" pub fn foo<'a, T>(f: Alias<'a, T>) -> Alias<'a, usize> { Alias(&0) } diff --git a/tests/rustdoc/inline_local/private-reexport-in-public-api-hidden-81141.rs b/tests/rustdoc/inline_local/private-reexport-in-public-api-hidden-81141.rs index 7d6fadf26e2..62127daaec8 100644 --- a/tests/rustdoc/inline_local/private-reexport-in-public-api-hidden-81141.rs +++ b/tests/rustdoc/inline_local/private-reexport-in-public-api-hidden-81141.rs @@ -10,8 +10,8 @@ mod bar { pub struct Bar; } -// @has 'foo/fn.bar.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar() -> Alias' +//@ has 'foo/fn.bar.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar() -> Alias' pub fn bar() -> Alias { Alias } diff --git a/tests/rustdoc/inline_local/private-reexport-in-public-api-private-81141.rs b/tests/rustdoc/inline_local/private-reexport-in-public-api-private-81141.rs index 6bf507838d5..adf41aa10cb 100644 --- a/tests/rustdoc/inline_local/private-reexport-in-public-api-private-81141.rs +++ b/tests/rustdoc/inline_local/private-reexport-in-public-api-private-81141.rs @@ -12,22 +12,22 @@ mod bar { } // It's a fully private re-export so it should not be displayed. -// @has 'foo/fn.bar.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar() -> Bar' +//@ has 'foo/fn.bar.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar() -> Bar' pub fn bar() -> Alias { Alias } // It's public re-export inside a private module so it should be visible. -// @has 'foo/fn.bar2.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar2() -> Inner' +//@ has 'foo/fn.bar2.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar2() -> Inner' pub fn bar2() -> crate::bar::Inner { Alias } // It's a non-public, so it doesn't appear in documentation so it should not be visible. -// @has 'foo/fn.bar3.html' -// @has - '//*[@class="rust item-decl"]/code' 'pub fn bar3() -> Bar' +//@ has 'foo/fn.bar3.html' +//@ has - '//*[@class="rust item-decl"]/code' 'pub fn bar3() -> Bar' pub fn bar3() -> CrateAlias { Alias } diff --git a/tests/rustdoc/inline_local/reexported-macro-and-macro-export-sidebar-89852.rs b/tests/rustdoc/inline_local/reexported-macro-and-macro-export-sidebar-89852.rs index cffe1289ce8..6cdfc71b13f 100644 --- a/tests/rustdoc/inline_local/reexported-macro-and-macro-export-sidebar-89852.rs +++ b/tests/rustdoc/inline_local/reexported-macro-and-macro-export-sidebar-89852.rs @@ -5,8 +5,8 @@ #![no_core] #![feature(no_core)] -// @matchesraw 'foo/sidebar-items.js' '"repro"' -// @!matchesraw 'foo/sidebar-items.js' '"repro".*"repro"' +//@ matchesraw 'foo/sidebar-items.js' '"repro"' +//@ !matchesraw 'foo/sidebar-items.js' '"repro".*"repro"' #[macro_export] macro_rules! repro { diff --git a/tests/rustdoc/inline_local/trait-vis.rs b/tests/rustdoc/inline_local/trait-vis.rs index 19b69da1513..1e5929a9ccf 100644 --- a/tests/rustdoc/inline_local/trait-vis.rs +++ b/tests/rustdoc/inline_local/trait-vis.rs @@ -12,7 +12,7 @@ mod asdf { impl PrivateTrait for SomeStruct {} } -// @has trait_vis/struct.SomeStruct.html -// @has - '//h3[@class="code-header"]' 'impl ThisTrait for SomeStruct' -// @!has - '//h3[@class="code-header"]' 'impl PrivateTrait for SomeStruct' +//@ has trait_vis/struct.SomeStruct.html +//@ has - '//h3[@class="code-header"]' 'impl ThisTrait for SomeStruct' +//@ !has - '//h3[@class="code-header"]' 'impl PrivateTrait for SomeStruct' pub use asdf::SomeStruct; diff --git a/tests/rustdoc/internal.rs b/tests/rustdoc/internal.rs index 4663965f621..e0bccefda1d 100644 --- a/tests/rustdoc/internal.rs +++ b/tests/rustdoc/internal.rs @@ -2,16 +2,16 @@ // Check that the unstable marker is not added for "rustc_private". -// @!matches internal/index.html \ +//@ !matches internal/index.html \ // '//*[@class="desc docblock-short"]/span[@class="stab unstable"]' \ // '' -// @!matches internal/index.html \ +//@ !matches internal/index.html \ // '//*[@class="desc docblock-short"]/span[@class="stab internal"]' \ // '' -// @matches - '//*[@class="desc docblock-short"]' 'Docs' +//@ matches - '//*[@class="desc docblock-short"]' 'Docs' -// @!has internal/struct.S.html '//*[@class="stab unstable"]' '' -// @!has internal/struct.S.html '//*[@class="stab internal"]' '' +//@ !has internal/struct.S.html '//*[@class="stab unstable"]' '' +//@ !has internal/struct.S.html '//*[@class="stab internal"]' '' /// Docs pub struct S; diff --git a/tests/rustdoc/intra-doc-crate/self.rs b/tests/rustdoc/intra-doc-crate/self.rs index 015611610ac..95b21a3303f 100644 --- a/tests/rustdoc/intra-doc-crate/self.rs +++ b/tests/rustdoc/intra-doc-crate/self.rs @@ -3,7 +3,7 @@ extern crate cross_crate_self; -// @has self/struct.S.html '//a[@href="struct.S.html#method.f"]' "Self::f" -// @has self/struct.S.html '//a[@href="struct.S.html"]' "Self" -// @has self/struct.S.html '//a[@href="../cross_crate_self/index.html"]' "crate" +//@ has self/struct.S.html '//a[@href="struct.S.html#method.f"]' "Self::f" +//@ has self/struct.S.html '//a[@href="struct.S.html"]' "Self" +//@ has self/struct.S.html '//a[@href="../cross_crate_self/index.html"]' "crate" pub use cross_crate_self::S; diff --git a/tests/rustdoc/intra-doc-link-method-trait-impl-72340.rs b/tests/rustdoc/intra-doc-link-method-trait-impl-72340.rs index 880a308f9ab..0cf46bb3f95 100644 --- a/tests/rustdoc/intra-doc-link-method-trait-impl-72340.rs +++ b/tests/rustdoc/intra-doc-link-method-trait-impl-72340.rs @@ -12,7 +12,7 @@ impl Body { } impl Default for Body { - // @has foo/struct.Body.html '//a/@href' 'struct.Body.html#method.empty' + //@ has foo/struct.Body.html '//a/@href' 'struct.Body.html#method.empty' /// Returns [`Body::empty()`](Body::empty). fn default() -> Body { diff --git a/tests/rustdoc/intra-doc/anchors.rs b/tests/rustdoc/intra-doc/anchors.rs index 3d4c464960b..68f8c4fefd9 100644 --- a/tests/rustdoc/intra-doc/anchors.rs +++ b/tests/rustdoc/intra-doc/anchors.rs @@ -3,8 +3,8 @@ /// # Anchor! pub struct Something; -// @has anchors/struct.SomeOtherType.html -// @has - '//a/@href' 'struct.Something.html#Anchor!' +//@ has anchors/struct.SomeOtherType.html +//@ has - '//a/@href' 'struct.Something.html#Anchor!' /// I want... /// @@ -14,11 +14,11 @@ pub struct SomeOtherType; /// Primitives? /// /// [u32#hello] -// @has anchors/fn.x.html -// @has - '//a/@href' '{{channel}}/std/primitive.u32.html#hello' +//@ has anchors/fn.x.html +//@ has - '//a/@href' '{{channel}}/std/primitive.u32.html#hello' pub fn x() {} /// [prim@usize#x] -// @has anchors/usize/index.html -// @has - '//a/@href' '{{channel}}/std/primitive.usize.html#x' +//@ has anchors/usize/index.html +//@ has - '//a/@href' '{{channel}}/std/primitive.usize.html#x' pub mod usize {} diff --git a/tests/rustdoc/intra-doc/assoc-reexport-super.rs b/tests/rustdoc/intra-doc/assoc-reexport-super.rs index a7bc1c6a29f..2a55586925f 100644 --- a/tests/rustdoc/intra-doc/assoc-reexport-super.rs +++ b/tests/rustdoc/intra-doc/assoc-reexport-super.rs @@ -14,7 +14,7 @@ pub use generated::MyNewType; mod prelude { impl super::MyNewType { /// An alias for [`Self::FOO`]. - // @has 'foo/struct.MyNewType.html' '//a[@href="struct.MyNewType.html#associatedconstant.FOO"]' 'Self::FOO' + //@ has 'foo/struct.MyNewType.html' '//a[@href="struct.MyNewType.html#associatedconstant.FOO"]' 'Self::FOO' pub const FOO2: Self = Self::FOO; } } diff --git a/tests/rustdoc/intra-doc/associated-defaults.rs b/tests/rustdoc/intra-doc/associated-defaults.rs index c7e66c826be..b5ba55dd30f 100644 --- a/tests/rustdoc/intra-doc/associated-defaults.rs +++ b/tests/rustdoc/intra-doc/associated-defaults.rs @@ -9,14 +9,14 @@ pub trait TraitWithDefault { } /// Link to [UsesDefaults::T] and [UsesDefaults::f] -// @has 'associated_defaults/struct.UsesDefaults.html' '//a[@href="struct.UsesDefaults.html#associatedtype.T"]' 'UsesDefaults::T' -// @has 'associated_defaults/struct.UsesDefaults.html' '//a[@href="struct.UsesDefaults.html#method.f"]' 'UsesDefaults::f' +//@ has 'associated_defaults/struct.UsesDefaults.html' '//a[@href="struct.UsesDefaults.html#associatedtype.T"]' 'UsesDefaults::T' +//@ has 'associated_defaults/struct.UsesDefaults.html' '//a[@href="struct.UsesDefaults.html#method.f"]' 'UsesDefaults::f' pub struct UsesDefaults; impl TraitWithDefault for UsesDefaults {} /// Link to [OverridesDefaults::T] and [OverridesDefaults::f] -// @has 'associated_defaults/struct.OverridesDefaults.html' '//a[@href="struct.OverridesDefaults.html#associatedtype.T"]' 'OverridesDefaults::T' -// @has 'associated_defaults/struct.OverridesDefaults.html' '//a[@href="struct.OverridesDefaults.html#method.f"]' 'OverridesDefaults::f' +//@ has 'associated_defaults/struct.OverridesDefaults.html' '//a[@href="struct.OverridesDefaults.html#associatedtype.T"]' 'OverridesDefaults::T' +//@ has 'associated_defaults/struct.OverridesDefaults.html' '//a[@href="struct.OverridesDefaults.html#method.f"]' 'OverridesDefaults::f' pub struct OverridesDefaults; impl TraitWithDefault for OverridesDefaults { type T = bool; diff --git a/tests/rustdoc/intra-doc/associated-items.rs b/tests/rustdoc/intra-doc/associated-items.rs index 0b958eb8eac..84cfd06111d 100644 --- a/tests/rustdoc/intra-doc/associated-items.rs +++ b/tests/rustdoc/intra-doc/associated-items.rs @@ -3,16 +3,16 @@ /// [`std::collections::BTreeMap::into_iter`] /// [`String::from`] is ambiguous as to which `From` impl /// [Vec::into_iter()] uses a disambiguator -// @has 'associated_items/fn.foo.html' '//a[@href="{{channel}}/alloc/collections/btree/map/struct.BTreeMap.html#method.into_iter"]' 'std::collections::BTreeMap::into_iter' -// @has 'associated_items/fn.foo.html' '//a[@href="{{channel}}/alloc/string/struct.String.html#method.from"]' 'String::from' -// @has 'associated_items/fn.foo.html' '//a[@href="{{channel}}/alloc/vec/struct.Vec.html#method.into_iter"]' 'Vec::into_iter' +//@ has 'associated_items/fn.foo.html' '//a[@href="{{channel}}/alloc/collections/btree/map/struct.BTreeMap.html#method.into_iter"]' 'std::collections::BTreeMap::into_iter' +//@ has 'associated_items/fn.foo.html' '//a[@href="{{channel}}/alloc/string/struct.String.html#method.from"]' 'String::from' +//@ has 'associated_items/fn.foo.html' '//a[@href="{{channel}}/alloc/vec/struct.Vec.html#method.into_iter"]' 'Vec::into_iter' pub fn foo() {} /// Link to [MyStruct], [link from struct][MyStruct::method], [MyStruct::clone], [MyStruct::Input] -// @has 'associated_items/struct.MyStruct.html' '//a[@href="struct.MyStruct.html"]' 'MyStruct' -// @has 'associated_items/struct.MyStruct.html' '//a[@href="struct.MyStruct.html#method.method"]' 'link from struct' -// @has 'associated_items/struct.MyStruct.html' '//a[@href="struct.MyStruct.html#method.clone"]' 'MyStruct::clone' -// @has 'associated_items/struct.MyStruct.html' '//a[@href="struct.MyStruct.html#associatedtype.Input"]' 'MyStruct::Input' +//@ has 'associated_items/struct.MyStruct.html' '//a[@href="struct.MyStruct.html"]' 'MyStruct' +//@ has 'associated_items/struct.MyStruct.html' '//a[@href="struct.MyStruct.html#method.method"]' 'link from struct' +//@ has 'associated_items/struct.MyStruct.html' '//a[@href="struct.MyStruct.html#method.clone"]' 'MyStruct::clone' +//@ has 'associated_items/struct.MyStruct.html' '//a[@href="struct.MyStruct.html#associatedtype.Input"]' 'MyStruct::Input' pub struct MyStruct { foo: () } impl Clone for MyStruct { @@ -30,7 +30,7 @@ impl T for MyStruct { type Input = usize; /// [link from method][MyStruct::method] on method - // @has 'associated_items/struct.MyStruct.html' '//a[@href="struct.MyStruct.html#method.method"]' 'link from method' + //@ has 'associated_items/struct.MyStruct.html' '//a[@href="struct.MyStruct.html#method.method"]' 'link from method' fn method(i: usize) { } } @@ -57,7 +57,7 @@ impl T2 for S { fn ambiguous_method() {} } -// @has associated_items/enum.MyEnum.html '//a/@href' 'enum.MyEnum.html#variant.MyVariant' +//@ has associated_items/enum.MyEnum.html '//a/@href' 'enum.MyEnum.html#variant.MyVariant' /// Link to [MyEnumAlias::MyVariant] pub enum MyEnum { MyVariant, diff --git a/tests/rustdoc/intra-doc/basic.rs b/tests/rustdoc/intra-doc/basic.rs index c88a7887f11..9d0d1d51647 100644 --- a/tests/rustdoc/intra-doc/basic.rs +++ b/tests/rustdoc/intra-doc/basic.rs @@ -1,44 +1,44 @@ #![allow(rustdoc::redundant_explicit_links)] -// @has basic/index.html -// @has - '//a/@href' 'struct.ThisType.html' -// @has - '//a/@title' 'struct basic::ThisType' -// @has - '//a/@href' 'struct.ThisType.html#method.this_method' -// @has - '//a/@title' 'method basic::ThisType::this_method' -// @has - '//a/@href' 'struct.ThisType.html#method.this_assoc_fn' -// @has - '//a/@title' 'associated function basic::ThisType::this_assoc_fn' -// @has - '//a/@href' 'enum.ThisEnum.html' -// @has - '//a/@title' 'enum basic::ThisEnum' -// @has - '//a/@href' 'enum.ThisEnum.html#variant.ThisVariant' -// @has - '//a/@title' 'variant basic::ThisEnum::ThisVariant' -// @has - '//a/@href' 'trait.ThisTrait.html' -// @has - '//a/@title' 'trait basic::ThisTrait' -// @has - '//a/@href' 'trait.ThisTrait.html#tymethod.this_associated_method' -// @has - '//a/@title' 'method basic::ThisTrait::this_associated_method' -// @has - '//a/@href' 'trait.ThisTrait.html#tymethod.this_associated_fn' -// @has - '//a/@title' 'associated function basic::ThisTrait::this_associated_fn' -// @has - '//a/@href' 'trait.ThisTrait.html#associatedtype.ThisAssociatedType' -// @has - '//a/@title' 'associated type basic::ThisTrait::ThisAssociatedType' -// @has - '//a/@href' 'trait.ThisTrait.html#associatedconstant.THIS_ASSOCIATED_CONST' -// @has - '//a/@title' 'associated constant basic::ThisTrait::THIS_ASSOCIATED_CONST' -// @has - '//a/@href' 'trait.ThisTrait.html' -// @has - '//a/@title' 'trait basic::ThisTrait' -// @has - '//a/@href' 'type.ThisAlias.html' -// @has - '//a/@title' 'type basic::ThisAlias' -// @has - '//a/@href' 'union.ThisUnion.html' -// @has - '//a/@title' 'union basic::ThisUnion' -// @has - '//a/@href' 'fn.this_function.html' -// @has - '//a/@title' 'fn basic::this_function' -// @has - '//a/@href' 'constant.THIS_CONST.html' -// @has - '//a/@title' 'constant basic::THIS_CONST' -// @has - '//a/@href' 'static.THIS_STATIC.html' -// @has - '//a/@title' 'static basic::THIS_STATIC' -// @has - '//a/@href' 'macro.this_macro.html' -// @has - '//a/@title' 'macro basic::this_macro' -// @has - '//a/@href' 'trait.SoAmbiguous.html' -// @has - '//a/@title' 'trait basic::SoAmbiguous' -// @has - '//a/@href' 'fn.SoAmbiguous.html' -// @has - '//a/@title' 'fn basic::SoAmbiguous' +//@ has basic/index.html +//@ has - '//a/@href' 'struct.ThisType.html' +//@ has - '//a/@title' 'struct basic::ThisType' +//@ has - '//a/@href' 'struct.ThisType.html#method.this_method' +//@ has - '//a/@title' 'method basic::ThisType::this_method' +//@ has - '//a/@href' 'struct.ThisType.html#method.this_assoc_fn' +//@ has - '//a/@title' 'associated function basic::ThisType::this_assoc_fn' +//@ has - '//a/@href' 'enum.ThisEnum.html' +//@ has - '//a/@title' 'enum basic::ThisEnum' +//@ has - '//a/@href' 'enum.ThisEnum.html#variant.ThisVariant' +//@ has - '//a/@title' 'variant basic::ThisEnum::ThisVariant' +//@ has - '//a/@href' 'trait.ThisTrait.html' +//@ has - '//a/@title' 'trait basic::ThisTrait' +//@ has - '//a/@href' 'trait.ThisTrait.html#tymethod.this_associated_method' +//@ has - '//a/@title' 'method basic::ThisTrait::this_associated_method' +//@ has - '//a/@href' 'trait.ThisTrait.html#tymethod.this_associated_fn' +//@ has - '//a/@title' 'associated function basic::ThisTrait::this_associated_fn' +//@ has - '//a/@href' 'trait.ThisTrait.html#associatedtype.ThisAssociatedType' +//@ has - '//a/@title' 'associated type basic::ThisTrait::ThisAssociatedType' +//@ has - '//a/@href' 'trait.ThisTrait.html#associatedconstant.THIS_ASSOCIATED_CONST' +//@ has - '//a/@title' 'associated constant basic::ThisTrait::THIS_ASSOCIATED_CONST' +//@ has - '//a/@href' 'trait.ThisTrait.html' +//@ has - '//a/@title' 'trait basic::ThisTrait' +//@ has - '//a/@href' 'type.ThisAlias.html' +//@ has - '//a/@title' 'type basic::ThisAlias' +//@ has - '//a/@href' 'union.ThisUnion.html' +//@ has - '//a/@title' 'union basic::ThisUnion' +//@ has - '//a/@href' 'fn.this_function.html' +//@ has - '//a/@title' 'fn basic::this_function' +//@ has - '//a/@href' 'constant.THIS_CONST.html' +//@ has - '//a/@title' 'constant basic::THIS_CONST' +//@ has - '//a/@href' 'static.THIS_STATIC.html' +//@ has - '//a/@title' 'static basic::THIS_STATIC' +//@ has - '//a/@href' 'macro.this_macro.html' +//@ has - '//a/@title' 'macro basic::this_macro' +//@ has - '//a/@href' 'trait.SoAmbiguous.html' +//@ has - '//a/@title' 'trait basic::SoAmbiguous' +//@ has - '//a/@href' 'fn.SoAmbiguous.html' +//@ has - '//a/@title' 'fn basic::SoAmbiguous' //! In this crate we would like to link to: //! //! * [`ThisType`](ThisType) @@ -71,7 +71,7 @@ macro_rules! this_macro { () => {}; } -// @has basic/struct.ThisType.html '//a/@href' 'macro.this_macro.html' +//@ has basic/struct.ThisType.html '//a/@href' 'macro.this_macro.html' /// another link to [`this_macro!()`] pub struct ThisType; @@ -99,10 +99,10 @@ pub trait SoAmbiguous {} pub fn SoAmbiguous() {} -// @has basic/struct.SomeOtherType.html '//a/@href' 'struct.ThisType.html' -// @has - '//a/@href' 'struct.ThisType.html#method.this_method' -// @has - '//a/@href' 'enum.ThisEnum.html' -// @has - '//a/@href' 'enum.ThisEnum.html#variant.ThisVariant' +//@ has basic/struct.SomeOtherType.html '//a/@href' 'struct.ThisType.html' +//@ has - '//a/@href' 'struct.ThisType.html#method.this_method' +//@ has - '//a/@href' 'enum.ThisEnum.html' +//@ has - '//a/@href' 'enum.ThisEnum.html#variant.ThisVariant' /// Shortcut links for: /// * [`ThisType`] /// * [`ThisType::this_method`] diff --git a/tests/rustdoc/intra-doc/builtin-macros.rs b/tests/rustdoc/intra-doc/builtin-macros.rs index bbdbe246bbc..12fc7c600ff 100644 --- a/tests/rustdoc/intra-doc/builtin-macros.rs +++ b/tests/rustdoc/intra-doc/builtin-macros.rs @@ -1,3 +1,3 @@ -// @has builtin_macros/index.html -// @has - '//a/@href' '{{channel}}/core/macro.cfg.html' +//@ has builtin_macros/index.html +//@ has - '//a/@href' '{{channel}}/core/macro.cfg.html' //! [cfg] diff --git a/tests/rustdoc/intra-doc/crate-relative-assoc.rs b/tests/rustdoc/intra-doc/crate-relative-assoc.rs index d4a0ecc35ae..1625b98dea6 100644 --- a/tests/rustdoc/intra-doc/crate-relative-assoc.rs +++ b/tests/rustdoc/intra-doc/crate-relative-assoc.rs @@ -5,7 +5,7 @@ pub mod io { } pub mod bufreader { - // @has crate_relative_assoc/bufreader/index.html '//a/@href' 'struct.TcpStream.html#method.read' + //@ has crate_relative_assoc/bufreader/index.html '//a/@href' 'struct.TcpStream.html#method.read' //! [`crate::TcpStream::read`] use crate::io::Read; } diff --git a/tests/rustdoc/intra-doc/crate-relative.rs b/tests/rustdoc/intra-doc/crate-relative.rs index bacbcabfc60..b4cae5e5585 100644 --- a/tests/rustdoc/intra-doc/crate-relative.rs +++ b/tests/rustdoc/intra-doc/crate-relative.rs @@ -6,8 +6,8 @@ impl<'a> Test<'a> { pub fn do_test(&self) {} } -// @has crate_relative/demo/index.html -// @has - '//a/@href' '../struct.Test.html#method.do_test' +//@ has crate_relative/demo/index.html +//@ has - '//a/@href' '../struct.Test.html#method.do_test' pub mod demo { //! [`crate::Test::do_test`] } diff --git a/tests/rustdoc/intra-doc/cross-crate/additional_doc.rs b/tests/rustdoc/intra-doc/cross-crate/additional_doc.rs index dc928c64f6d..02e4ada14a3 100644 --- a/tests/rustdoc/intra-doc/cross-crate/additional_doc.rs +++ b/tests/rustdoc/intra-doc/cross-crate/additional_doc.rs @@ -4,7 +4,7 @@ extern crate my_rand; -// @has 'additional_doc/trait.Rng.html' '//a[@href="trait.Rng.html"]' 'Rng' -// @has 'additional_doc/trait.Rng.html' '//a[@href="../my_rand/trait.RngCore.html"]' 'RngCore' +//@ has 'additional_doc/trait.Rng.html' '//a[@href="trait.Rng.html"]' 'Rng' +//@ has 'additional_doc/trait.Rng.html' '//a[@href="../my_rand/trait.RngCore.html"]' 'RngCore' /// This is an [`Rng`]. pub use my_rand::Rng; diff --git a/tests/rustdoc/intra-doc/cross-crate/basic.rs b/tests/rustdoc/intra-doc/cross-crate/basic.rs index f17c638b578..45f7a8a2b6b 100644 --- a/tests/rustdoc/intra-doc/cross-crate/basic.rs +++ b/tests/rustdoc/intra-doc/cross-crate/basic.rs @@ -5,5 +5,5 @@ // from https://github.com/rust-lang/rust/issues/65983 extern crate a; -// @has 'basic/struct.Bar.html' '//a[@href="../a/struct.Foo.html"]' 'Foo' +//@ has 'basic/struct.Bar.html' '//a[@href="../a/struct.Foo.html"]' 'Foo' pub use a::Bar; diff --git a/tests/rustdoc/intra-doc/cross-crate/crate.rs b/tests/rustdoc/intra-doc/cross-crate/crate.rs index 34fff1f1f26..511812f2bdb 100644 --- a/tests/rustdoc/intra-doc/cross-crate/crate.rs +++ b/tests/rustdoc/intra-doc/cross-crate/crate.rs @@ -2,5 +2,5 @@ //@ build-aux-docs #![crate_name = "outer"] extern crate inner; -// @has outer/fn.f.html '//a[@href="../inner/fn.g.html"]' "crate::g" +//@ has outer/fn.f.html '//a[@href="../inner/fn.g.html"]' "crate::g" pub use inner::f; diff --git a/tests/rustdoc/intra-doc/cross-crate/hidden.rs b/tests/rustdoc/intra-doc/cross-crate/hidden.rs index 026c0fb4fdb..490f1d23ca0 100644 --- a/tests/rustdoc/intra-doc/cross-crate/hidden.rs +++ b/tests/rustdoc/intra-doc/cross-crate/hidden.rs @@ -6,5 +6,5 @@ extern crate hidden_dep; -// @has 'hidden/struct.Ready.html' '//a/@href' 'fn.ready.html' +//@ has 'hidden/struct.Ready.html' '//a/@href' 'fn.ready.html' pub use hidden_dep::future::{ready, Ready}; diff --git a/tests/rustdoc/intra-doc/cross-crate/macro.rs b/tests/rustdoc/intra-doc/cross-crate/macro.rs index cd8f1c3969f..19ca5f6f243 100644 --- a/tests/rustdoc/intra-doc/cross-crate/macro.rs +++ b/tests/rustdoc/intra-doc/cross-crate/macro.rs @@ -5,7 +5,7 @@ extern crate macro_inner; extern crate proc_macro_inner; -// @has 'macro/macro.my_macro.html' '//a[@href="../macro_inner/struct.Foo.html"]' 'Foo' +//@ has 'macro/macro.my_macro.html' '//a[@href="../macro_inner/struct.Foo.html"]' 'Foo' pub use macro_inner::my_macro; -// @has 'macro/derive.DeriveA.html' '//a[@href="../proc_macro_inner/derive.OtherDerive.html"]' 'OtherDerive' +//@ has 'macro/derive.DeriveA.html' '//a[@href="../proc_macro_inner/derive.OtherDerive.html"]' 'OtherDerive' pub use proc_macro_inner::DeriveA; diff --git a/tests/rustdoc/intra-doc/cross-crate/module.rs b/tests/rustdoc/intra-doc/cross-crate/module.rs index 2323cc94f8a..0f9fa4e2276 100644 --- a/tests/rustdoc/intra-doc/cross-crate/module.rs +++ b/tests/rustdoc/intra-doc/cross-crate/module.rs @@ -3,6 +3,6 @@ //@ build-aux-docs #![deny(rustdoc::broken_intra_doc_links)] extern crate module_inner; -// @has 'module/bar/index.html' '//a[@href="../../module_inner/trait.SomeTrait.html"]' 'SomeTrait' -// @has 'module/bar/index.html' '//a[@href="../../module_inner/struct.SomeType.html"]' 'SomeType' +//@ has 'module/bar/index.html' '//a[@href="../../module_inner/trait.SomeTrait.html"]' 'SomeTrait' +//@ has 'module/bar/index.html' '//a[@href="../../module_inner/struct.SomeType.html"]' 'SomeType' pub use module_inner::bar; diff --git a/tests/rustdoc/intra-doc/cross-crate/submodule-inner.rs b/tests/rustdoc/intra-doc/cross-crate/submodule-inner.rs index 08996826561..cc139e3daaf 100644 --- a/tests/rustdoc/intra-doc/cross-crate/submodule-inner.rs +++ b/tests/rustdoc/intra-doc/cross-crate/submodule-inner.rs @@ -4,5 +4,5 @@ extern crate a; -// @has 'submodule_inner/struct.Foo.html' '//a[@href="../a/bar/struct.Bar.html"]' 'Bar' +//@ has 'submodule_inner/struct.Foo.html' '//a[@href="../a/bar/struct.Bar.html"]' 'Bar' pub use a::foo::Foo; diff --git a/tests/rustdoc/intra-doc/cross-crate/submodule-outer.rs b/tests/rustdoc/intra-doc/cross-crate/submodule-outer.rs index 29b98036a96..93121a6938d 100644 --- a/tests/rustdoc/intra-doc/cross-crate/submodule-outer.rs +++ b/tests/rustdoc/intra-doc/cross-crate/submodule-outer.rs @@ -11,6 +11,6 @@ pub mod bar { // NOTE: we re-exported both `Foo` and `Bar` here, // NOTE: so they are inlined and therefore we link to the current module. -// @has 'submodule_outer/trait.Foo.html' '//a[@href="bar/trait.Bar.html"]' 'Bar' -// @has 'submodule_outer/trait.Foo.html' '//a[@href="trait.Baz.html"]' 'Baz' +//@ has 'submodule_outer/trait.Foo.html' '//a[@href="bar/trait.Bar.html"]' 'Bar' +//@ has 'submodule_outer/trait.Foo.html' '//a[@href="trait.Baz.html"]' 'Baz' pub use ::bar_::{Foo, Baz}; diff --git a/tests/rustdoc/intra-doc/cross-crate/traits.rs b/tests/rustdoc/intra-doc/cross-crate/traits.rs index 4b1625e5a51..70382062a61 100644 --- a/tests/rustdoc/intra-doc/cross-crate/traits.rs +++ b/tests/rustdoc/intra-doc/cross-crate/traits.rs @@ -7,8 +7,8 @@ use inner::SomeTrait; pub struct SomeStruct; - // @has 'traits/struct.SomeStruct.html' '//a[@href="../inner/trait.SomeTrait.html"]' 'SomeTrait' + //@ has 'traits/struct.SomeStruct.html' '//a[@href="../inner/trait.SomeTrait.html"]' 'SomeTrait' impl SomeTrait for SomeStruct { - // @has 'traits/struct.SomeStruct.html' '//a[@href="../inner/trait.SomeTrait.html"]' 'a trait' + //@ has 'traits/struct.SomeStruct.html' '//a[@href="../inner/trait.SomeTrait.html"]' 'a trait' fn foo() {} } diff --git a/tests/rustdoc/intra-doc/disambiguators-removed.rs b/tests/rustdoc/intra-doc/disambiguators-removed.rs index 331a314130a..613156222ed 100644 --- a/tests/rustdoc/intra-doc/disambiguators-removed.rs +++ b/tests/rustdoc/intra-doc/disambiguators-removed.rs @@ -1,50 +1,50 @@ #![deny(rustdoc::broken_intra_doc_links)] // first try backticks /// Trait: [`trait@Name`], fn: [`fn@Name`], [`Name`][`macro@Name`] -// @has disambiguators_removed/struct.AtDisambiguator.html -// @has - '//a[@href="trait.Name.html"][code]' "Name" -// @has - '//a[@href="fn.Name.html"][code]' "Name" -// @has - '//a[@href="macro.Name.html"][code]' "Name" +//@ has disambiguators_removed/struct.AtDisambiguator.html +//@ has - '//a[@href="trait.Name.html"][code]' "Name" +//@ has - '//a[@href="fn.Name.html"][code]' "Name" +//@ has - '//a[@href="macro.Name.html"][code]' "Name" pub struct AtDisambiguator; /// fn: [`Name()`], macro: [`Name!`] -// @has disambiguators_removed/struct.SymbolDisambiguator.html -// @has - '//a[@href="fn.Name.html"][code]' "Name()" -// @has - '//a[@href="macro.Name.html"][code]' "Name!" +//@ has disambiguators_removed/struct.SymbolDisambiguator.html +//@ has - '//a[@href="fn.Name.html"][code]' "Name()" +//@ has - '//a[@href="macro.Name.html"][code]' "Name!" pub struct SymbolDisambiguator; // Now make sure that backticks aren't added if they weren't already there /// [fn@Name] -// @has disambiguators_removed/trait.Name.html -// @has - '//a[@href="fn.Name.html"]' "Name" -// @!has - '//a[@href="fn.Name.html"][code]' "Name" +//@ has disambiguators_removed/trait.Name.html +//@ has - '//a[@href="fn.Name.html"]' "Name" +//@ !has - '//a[@href="fn.Name.html"][code]' "Name" // FIXME: this will turn !() into ! alone /// [Name!()] -// @has - '//a[@href="macro.Name.html"]' "Name!" +//@ has - '//a[@href="macro.Name.html"]' "Name!" pub trait Name {} #[allow(non_snake_case)] // Try collapsed reference links /// [macro@Name][] -// @has disambiguators_removed/fn.Name.html -// @has - '//a[@href="macro.Name.html"]' "Name" +//@ has disambiguators_removed/fn.Name.html +//@ has - '//a[@href="macro.Name.html"]' "Name" // Try links that have the same text as a generated URL /// Weird URL aligned [macro.Name.html][trait@Name] -// @has - '//a[@href="trait.Name.html"]' "macro.Name.html" +//@ has - '//a[@href="trait.Name.html"]' "macro.Name.html" pub fn Name() {} #[macro_export] // Rustdoc doesn't currently handle links that have weird interspersing of inline code blocks. /// [fn@Na`m`e] -// @has disambiguators_removed/macro.Name.html -// @has - '//a[@href="fn.Name.html"]' "fn@Name" +//@ has disambiguators_removed/macro.Name.html +//@ has - '//a[@href="fn.Name.html"]' "fn@Name" // It also doesn't handle any case where the code block isn't the whole link text: /// [trait@`Name`] -// @has - '//a[@href="trait.Name.html"]' "trait@Name" +//@ has - '//a[@href="trait.Name.html"]' "trait@Name" macro_rules! Name { () => () } diff --git a/tests/rustdoc/intra-doc/email-address.rs b/tests/rustdoc/intra-doc/email-address.rs index 24161c3bb48..f689139357e 100644 --- a/tests/rustdoc/intra-doc/email-address.rs +++ b/tests/rustdoc/intra-doc/email-address.rs @@ -4,7 +4,7 @@ //! Email me at . //! Email me at . //! Email me at . -// @has email_address/index.html '//a[@href="mailto:hello@example.com"]' 'hello@example.com' -// @has email_address/index.html '//a[@href="mailto:hello-world@example.com"]' 'hello-world@example.com' -// @has email_address/index.html '//a[@href="mailto:hello@localhost"]' 'hello@localhost' -// @has email_address/index.html '//a[@href="mailto:prim@i32"]' 'prim@i32' +//@ has email_address/index.html '//a[@href="mailto:hello@example.com"]' 'hello@example.com' +//@ has email_address/index.html '//a[@href="mailto:hello-world@example.com"]' 'hello-world@example.com' +//@ has email_address/index.html '//a[@href="mailto:hello@localhost"]' 'hello@localhost' +//@ has email_address/index.html '//a[@href="mailto:prim@i32"]' 'prim@i32' diff --git a/tests/rustdoc/intra-doc/enum-struct-field.rs b/tests/rustdoc/intra-doc/enum-struct-field.rs index 2270a1fafa1..71ba53b877f 100644 --- a/tests/rustdoc/intra-doc/enum-struct-field.rs +++ b/tests/rustdoc/intra-doc/enum-struct-field.rs @@ -11,4 +11,4 @@ pub enum Foo { /// I want [Foo::X::y]. pub fn foo() {} -// @has foo/fn.foo.html '//a/@href' 'enum.Foo.html#variant.X.field.y' +//@ has foo/fn.foo.html '//a/@href' 'enum.Foo.html#variant.X.field.y' diff --git a/tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs b/tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs index cbe5bf912a5..7cec30c8b74 100644 --- a/tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs +++ b/tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs @@ -8,12 +8,12 @@ //@ build-aux-docs //@ compile-flags:-Z unstable-options --edition 2018 -// @has extern_crate_only_used_in_link/index.html -// @has - '//a[@href="../issue_66159_1/struct.Something.html"]' 'issue_66159_1::Something' +//@ has extern_crate_only_used_in_link/index.html +//@ has - '//a[@href="../issue_66159_1/struct.Something.html"]' 'issue_66159_1::Something' //! [issue_66159_1::Something] -// @has - '//a[@href="../empty/index.html"]' 'empty' +//@ has - '//a[@href="../empty/index.html"]' 'empty' //! [`empty`] -// @has - '//a[@href="../empty2/index.html"]' 'empty2' +//@ has - '//a[@href="../empty2/index.html"]' 'empty2' //! [`empty2`] diff --git a/tests/rustdoc/intra-doc/extern-type.rs b/tests/rustdoc/intra-doc/extern-type.rs index 5440f582dff..198ac8e43e0 100644 --- a/tests/rustdoc/intra-doc/extern-type.rs +++ b/tests/rustdoc/intra-doc/extern-type.rs @@ -24,12 +24,12 @@ impl G for ExternType { fn g(&self, n: usize) {} } -// @has 'extern_type/foreigntype.ExternType.html' -// @hasraw 'extern_type/fn.links_to_extern_type.html' \ +//@ has 'extern_type/foreigntype.ExternType.html' +//@ hasraw 'extern_type/fn.links_to_extern_type.html' \ // 'href="foreigntype.ExternType.html#method.f"' -// @hasraw 'extern_type/fn.links_to_extern_type.html' \ +//@ hasraw 'extern_type/fn.links_to_extern_type.html' \ // 'href="foreigntype.ExternType.html#method.test"' -// @hasraw 'extern_type/fn.links_to_extern_type.html' \ +//@ hasraw 'extern_type/fn.links_to_extern_type.html' \ // 'href="foreigntype.ExternType.html#method.g"' /// See also [ExternType::f] /// See also [ExternType::test] diff --git a/tests/rustdoc/intra-doc/field.rs b/tests/rustdoc/intra-doc/field.rs index 00114348924..ba6b320e560 100644 --- a/tests/rustdoc/intra-doc/field.rs +++ b/tests/rustdoc/intra-doc/field.rs @@ -1,4 +1,4 @@ -// @has field/index.html '//a[@href="{{channel}}/core/ops/range/struct.Range.html#structfield.start"]' 'start' -// @has field/index.html '//a[@href="{{channel}}/std/io/error/enum.ErrorKind.html#variant.NotFound"]' 'not_found' +//@ has field/index.html '//a[@href="{{channel}}/core/ops/range/struct.Range.html#structfield.start"]' 'start' +//@ has field/index.html '//a[@href="{{channel}}/std/io/error/enum.ErrorKind.html#variant.NotFound"]' 'not_found' //! [start][std::ops::Range::start] //! [not_found][std::io::ErrorKind::NotFound] diff --git a/tests/rustdoc/intra-doc/generic-params.rs b/tests/rustdoc/intra-doc/generic-params.rs index 359f775f97f..64e13c2e3ca 100644 --- a/tests/rustdoc/intra-doc/generic-params.rs +++ b/tests/rustdoc/intra-doc/generic-params.rs @@ -6,40 +6,40 @@ //! Here's a link to [`Vec`] and one to [`Box>>`]. //! Here's a link to [`Iterator>::Item`]. //! -// @has foo/index.html '//a[@href="{{channel}}/alloc/vec/struct.Vec.html"]' 'Vec' -// @has foo/index.html '//a[@href="{{channel}}/alloc/boxed/struct.Box.html"]' 'Box>>' -// @has foo/index.html '//a[@href="{{channel}}/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item"]' 'Iterator>::Item' +//@ has foo/index.html '//a[@href="{{channel}}/alloc/vec/struct.Vec.html"]' 'Vec' +//@ has foo/index.html '//a[@href="{{channel}}/alloc/boxed/struct.Box.html"]' 'Box>>' +//@ has foo/index.html '//a[@href="{{channel}}/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item"]' 'Iterator>::Item' //! And what about a link to [just `Option`](Option) and, [with the generic, `Option`](Option)? //! -// @has foo/index.html '//a[@href="{{channel}}/core/option/enum.Option.html"]' 'just Option' -// @has foo/index.html '//a[@href="{{channel}}/core/option/enum.Option.html"]' 'with the generic, Option' +//@ has foo/index.html '//a[@href="{{channel}}/core/option/enum.Option.html"]' 'just Option' +//@ has foo/index.html '//a[@href="{{channel}}/core/option/enum.Option.html"]' 'with the generic, Option' //! We should also try linking to [`Result`]; it has *two* generics! //! And [`Result`] and [`Result`]. //! -// @has foo/index.html '//a[@href="{{channel}}/core/result/enum.Result.html"]' 'Result' -// @has foo/index.html '//a[@href="{{channel}}/core/result/enum.Result.html"]' 'Result' -// @has foo/index.html '//a[@href="{{channel}}/core/result/enum.Result.html"]' 'Result' +//@ has foo/index.html '//a[@href="{{channel}}/core/result/enum.Result.html"]' 'Result' +//@ has foo/index.html '//a[@href="{{channel}}/core/result/enum.Result.html"]' 'Result' +//@ has foo/index.html '//a[@href="{{channel}}/core/result/enum.Result.html"]' 'Result' //! Now let's test a trickier case: [`Vec::::new`], or you could write it //! [with parentheses as `Vec::::new()`][Vec::::new()]. //! And what about something even harder? That would be [`Vec::>::new()`]. //! -// @has foo/index.html '//a[@href="{{channel}}/alloc/vec/struct.Vec.html#method.new"]' 'Vec::::new' -// @has foo/index.html '//a[@href="{{channel}}/alloc/vec/struct.Vec.html#method.new"]' 'with parentheses as Vec::::new()' -// @has foo/index.html '//a[@href="{{channel}}/alloc/vec/struct.Vec.html#method.new"]' 'Vec::>::new()' +//@ has foo/index.html '//a[@href="{{channel}}/alloc/vec/struct.Vec.html#method.new"]' 'Vec::::new' +//@ has foo/index.html '//a[@href="{{channel}}/alloc/vec/struct.Vec.html#method.new"]' 'with parentheses as Vec::::new()' +//@ has foo/index.html '//a[@href="{{channel}}/alloc/vec/struct.Vec.html#method.new"]' 'Vec::>::new()' //! This is also pretty tricky: [`TypeId::of::()`]. //! And this too: [`Vec::::len`]. //! -// @has foo/index.html '//a[@href="{{channel}}/core/any/struct.TypeId.html#method.of"]' 'TypeId::of::()' -// @has foo/index.html '//a[@href="{{channel}}/alloc/vec/struct.Vec.html#method.len"]' 'Vec::::len' +//@ has foo/index.html '//a[@href="{{channel}}/core/any/struct.TypeId.html#method.of"]' 'TypeId::of::()' +//@ has foo/index.html '//a[@href="{{channel}}/alloc/vec/struct.Vec.html#method.len"]' 'Vec::::len' //! We unofficially and implicitly support things that aren't valid in the actual Rust syntax, like //! [`Box::new()`]. We may not support them in the future! //! -// @has foo/index.html '//a[@href="{{channel}}/alloc/boxed/struct.Box.html#method.new"]' 'Box::new()' +//@ has foo/index.html '//a[@href="{{channel}}/alloc/boxed/struct.Box.html#method.new"]' 'Box::new()' //! These will be resolved as regular links: //! - [`this is first`](https://www.rust-lang.org) @@ -53,11 +53,11 @@ //! [rlo]: https://www.rust-lang.org //! [c > d]: https://www.rust-lang.org //! -// @has foo/index.html '//a[@href="https://www.rust-lang.org"]' 'this is first' -// @has foo/index.html '//a[@href="https://www.rust-lang.org"]' 'this is twice' -// @has foo/index.html '//a[@href="https://www.rust-lang.org"]' ' thrice' -// @has foo/index.html '//a[@href="https://www.rust-lang.org"]' ' four times' -// @has foo/index.html '//a[@href="https://www.rust-lang.org"]' 'a < b' -// @has foo/index.html '//a[@href="https://www.rust-lang.org"]' 'c > d' +//@ has foo/index.html '//a[@href="https://www.rust-lang.org"]' 'this is first' +//@ has foo/index.html '//a[@href="https://www.rust-lang.org"]' 'this is twice' +//@ has foo/index.html '//a[@href="https://www.rust-lang.org"]' ' thrice' +//@ has foo/index.html '//a[@href="https://www.rust-lang.org"]' ' four times' +//@ has foo/index.html '//a[@href="https://www.rust-lang.org"]' 'a < b' +//@ has foo/index.html '//a[@href="https://www.rust-lang.org"]' 'c > d' use std::any::TypeId; diff --git a/tests/rustdoc/intra-doc/generic-trait-impl.rs b/tests/rustdoc/intra-doc/generic-trait-impl.rs index ba8595abfa9..314b6321cbb 100644 --- a/tests/rustdoc/intra-doc/generic-trait-impl.rs +++ b/tests/rustdoc/intra-doc/generic-trait-impl.rs @@ -15,6 +15,6 @@ impl Bar for Foo { fn bar(&self) {} } -// @has generic_trait_impl/fn.main.html '//a[@href="struct.Foo.html#method.bar"]' 'Foo::bar' +//@ has generic_trait_impl/fn.main.html '//a[@href="struct.Foo.html#method.bar"]' 'Foo::bar' /// link to [`Foo::bar`] pub fn main() {} diff --git a/tests/rustdoc/intra-doc/inherent-associated-types.rs b/tests/rustdoc/intra-doc/inherent-associated-types.rs index 2b28d2ae60b..b7eedee2c17 100644 --- a/tests/rustdoc/intra-doc/inherent-associated-types.rs +++ b/tests/rustdoc/intra-doc/inherent-associated-types.rs @@ -3,9 +3,9 @@ #![allow(incomplete_features)] #![deny(rustdoc::broken_intra_doc_links)] -// @has inherent_associated_types/index.html +//@ has inherent_associated_types/index.html -// @has - '//a/@href' 'enum.Simple.html#associatedtype.Type' +//@ has - '//a/@href' 'enum.Simple.html#associatedtype.Type' //! [`Simple::Type`] pub enum Simple {} @@ -16,7 +16,7 @@ impl Simple { //////////////////////////////////////// -// @has 'inherent_associated_types/type.Test0.html' '//a/@href' \ +//@ has 'inherent_associated_types/type.Test0.html' '//a/@href' \ // 'struct.Parametrized.html#associatedtype.Proj' /// [`Parametrized::Proj`] pub type Test0 = (); @@ -28,9 +28,9 @@ pub type Test0 = (); // Further, at some point we should reject the intra-doc link `Parametrized::Proj`. // It currently links to `Parametrized::Proj`. -// @has 'inherent_associated_types/type.Test1.html' -// @has - '//a/@href' 'struct.Parametrized.html#associatedtype.Proj' -// @!has - '//a/@href' 'struct.Parametrized.html#associatedtype.Proj-1' +//@ has 'inherent_associated_types/type.Test1.html' +//@ has - '//a/@href' 'struct.Parametrized.html#associatedtype.Proj' +//@ !has - '//a/@href' 'struct.Parametrized.html#associatedtype.Proj-1' /// [`Parametrized::Proj`] pub type Test1 = (); diff --git a/tests/rustdoc/intra-doc/issue-108459.rs b/tests/rustdoc/intra-doc/issue-108459.rs index b8cd478b4df..18424c069d3 100644 --- a/tests/rustdoc/intra-doc/issue-108459.rs +++ b/tests/rustdoc/intra-doc/issue-108459.rs @@ -13,26 +13,26 @@ pub struct MyStruct1; // the same target but different text /// See also [crate::char] and [mod@char] and [prim@char] -// @has issue_108459/struct.MyStruct2.html '//*[@href="char/index.html"]' 'crate::char' -// @has - '//*[@href="char/index.html"]' 'char' -// @has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' +//@ has issue_108459/struct.MyStruct2.html '//*[@href="char/index.html"]' 'crate::char' +//@ has - '//*[@href="char/index.html"]' 'char' +//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' pub struct MyStruct2; /// See also [mod@char] and [prim@char] and [crate::char] -// @has issue_108459/struct.MyStruct3.html '//*[@href="char/index.html"]' 'crate::char' -// @has - '//*[@href="char/index.html"]' 'char' -// @has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' +//@ has issue_108459/struct.MyStruct3.html '//*[@href="char/index.html"]' 'crate::char' +//@ has - '//*[@href="char/index.html"]' 'char' +//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' pub struct MyStruct3; // Ensure that links are correct even if there are multiple links with the same text but // different targets /// See also [char][mod@char] and [char][prim@char] -// @has issue_108459/struct.MyStruct4.html '//*[@href="char/index.html"]' 'char' -// @has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' +//@ has issue_108459/struct.MyStruct4.html '//*[@href="char/index.html"]' 'char' +//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' pub struct MyStruct4; /// See also [char][prim@char] and [char][crate::char] -// @has issue_108459/struct.MyStruct5.html '//*[@href="char/index.html"]' 'char' -// @has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' +//@ has issue_108459/struct.MyStruct5.html '//*[@href="char/index.html"]' 'char' +//@ has - '//*[@href="{{channel}}/std/primitive.char.html"]' 'char' pub struct MyStruct5; diff --git a/tests/rustdoc/intra-doc/issue-66159.rs b/tests/rustdoc/intra-doc/issue-66159.rs index b3e7f9171ad..5d50f63f299 100644 --- a/tests/rustdoc/intra-doc/issue-66159.rs +++ b/tests/rustdoc/intra-doc/issue-66159.rs @@ -6,5 +6,5 @@ // Since we don't generate the docs for the auxiliary files, we can't actually // verify that the struct is linked correctly. -// @has issue_66159/index.html +//@ has issue_66159/index.html //! [pub_struct::SomeStruct] diff --git a/tests/rustdoc/intra-doc/issue-82209.rs b/tests/rustdoc/intra-doc/issue-82209.rs index a5fe855cb36..46d028e535c 100644 --- a/tests/rustdoc/intra-doc/issue-82209.rs +++ b/tests/rustdoc/intra-doc/issue-82209.rs @@ -8,4 +8,4 @@ pub enum Foo { }, } -// @has foo/enum.Foo.html '//a/@href' 'enum.Foo.html#variant.Bar.field.abc' +//@ has foo/enum.Foo.html '//a/@href' 'enum.Foo.html#variant.Bar.field.abc' diff --git a/tests/rustdoc/intra-doc/macros-disambiguators.rs b/tests/rustdoc/intra-doc/macros-disambiguators.rs index cd4caa6a894..d84ab8011dc 100644 --- a/tests/rustdoc/intra-doc/macros-disambiguators.rs +++ b/tests/rustdoc/intra-doc/macros-disambiguators.rs @@ -2,22 +2,22 @@ #![deny(rustdoc::broken_intra_doc_links)] //! [foo!()] -// @has foo/index.html '//a[@href="macro.foo.html"]' 'foo!()' +//@ has foo/index.html '//a[@href="macro.foo.html"]' 'foo!()' //! [foo!{}] -// @has - '//a[@href="macro.foo.html"]' 'foo!{}' +//@ has - '//a[@href="macro.foo.html"]' 'foo!{}' //! [foo![]](foo![]) -// @has - '//a[@href="macro.foo.html"]' 'foo![]' +//@ has - '//a[@href="macro.foo.html"]' 'foo![]' //! [foo1](foo!()) -// @has - '//a[@href="macro.foo.html"]' 'foo1' +//@ has - '//a[@href="macro.foo.html"]' 'foo1' //! [foo2](foo!{}) -// @has - '//a[@href="macro.foo.html"]' 'foo2' +//@ has - '//a[@href="macro.foo.html"]' 'foo2' //! [foo3](foo![]) -// @has - '//a[@href="macro.foo.html"]' 'foo3' +//@ has - '//a[@href="macro.foo.html"]' 'foo3' #[macro_export] macro_rules! foo { diff --git a/tests/rustdoc/intra-doc/mod-ambiguity.rs b/tests/rustdoc/intra-doc/mod-ambiguity.rs index 0c7acbaf093..5e2b1ffe6f2 100644 --- a/tests/rustdoc/intra-doc/mod-ambiguity.rs +++ b/tests/rustdoc/intra-doc/mod-ambiguity.rs @@ -6,11 +6,11 @@ pub fn foo() { } pub mod foo {} -// @has mod_ambiguity/struct.A.html '//a/@href' 'foo/index.html' +//@ has mod_ambiguity/struct.A.html '//a/@href' 'foo/index.html' /// Module is [`module@foo`] pub struct A; -// @has mod_ambiguity/struct.B.html '//a/@href' 'fn.foo.html' +//@ has mod_ambiguity/struct.B.html '//a/@href' 'fn.foo.html' /// Function is [`fn@foo`] pub struct B; diff --git a/tests/rustdoc/intra-doc/mod-relative.rs b/tests/rustdoc/intra-doc/mod-relative.rs index 49d3399b972..d3239973d1c 100644 --- a/tests/rustdoc/intra-doc/mod-relative.rs +++ b/tests/rustdoc/intra-doc/mod-relative.rs @@ -8,8 +8,8 @@ pub mod wrapper { pub fn do_test(&self) {} } - // @has mod_relative/wrapper/demo/index.html - // @has - '//a/@href' '../struct.Test.html#method.do_test' + //@ has mod_relative/wrapper/demo/index.html + //@ has - '//a/@href' '../struct.Test.html#method.do_test' /// [`Test::do_test`] pub mod demo { } diff --git a/tests/rustdoc/intra-doc/module-scope-name-resolution-55364.rs b/tests/rustdoc/intra-doc/module-scope-name-resolution-55364.rs index c07aba628c9..06cb764423e 100644 --- a/tests/rustdoc/intra-doc/module-scope-name-resolution-55364.rs +++ b/tests/rustdoc/intra-doc/module-scope-name-resolution-55364.rs @@ -3,50 +3,50 @@ // First a module with inner documentation -// @has foo/subone/index.html +//@ has foo/subone/index.html // These foo/bar links in the module's documentation should refer inside `subone` -// @has - '//section[@id="main-content"]/details[@open=""]/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo' -// @has - '//section[@id="main-content"]/details[@open=""]/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar' +//@ has - '//section[@id="main-content"]/details[@open=""]/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo' +//@ has - '//section[@id="main-content"]/details[@open=""]/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar' pub mod subone { //! See either [foo] or [bar]. // This should refer to subone's `bar` - // @has foo/subone/fn.foo.html - // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar' + //@ has foo/subone/fn.foo.html + //@ has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar' /// See [bar] pub fn foo() {} // This should refer to subone's `foo` - // @has foo/subone/fn.bar.html - // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo' + //@ has foo/subone/fn.bar.html + //@ has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo' /// See [foo] pub fn bar() {} } // A module with outer documentation -// @has foo/subtwo/index.html +//@ has foo/subtwo/index.html // These foo/bar links in the module's documentation should not reference inside `subtwo` -// @!has - '//section[@id="main-content"]/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo' -// @!has - '//section[@id="main-content"]/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar' +//@ !has - '//section[@id="main-content"]/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo' +//@ !has - '//section[@id="main-content"]/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar' // Instead it should be referencing the top level functions -// @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.foo.html"]' 'foo' -// @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.bar.html"]' 'bar' +//@ has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.foo.html"]' 'foo' +//@ has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.bar.html"]' 'bar' // Though there should be such links later -// @has - '//section[@id="main-content"]/ul[@class="item-table"]//div[@class="item-name"]/a[@class="fn"][@href="fn.foo.html"]' 'foo' -// @has - '//section[@id="main-content"]/ul[@class="item-table"]//div[@class="item-name"]/a[@class="fn"][@href="fn.bar.html"]' 'bar' +//@ has - '//section[@id="main-content"]/ul[@class="item-table"]//div[@class="item-name"]/a[@class="fn"][@href="fn.foo.html"]' 'foo' +//@ has - '//section[@id="main-content"]/ul[@class="item-table"]//div[@class="item-name"]/a[@class="fn"][@href="fn.bar.html"]' 'bar' /// See either [foo] or [bar]. pub mod subtwo { // Despite the module's docs referring to the top level foo/bar, // this should refer to subtwo's `bar` - // @has foo/subtwo/fn.foo.html - // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar' + //@ has foo/subtwo/fn.foo.html + //@ has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar' /// See [bar] pub fn foo() {} // Despite the module's docs referring to the top level foo/bar, // this should refer to subtwo's `foo` - // @has foo/subtwo/fn.bar.html - // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo' + //@ has foo/subtwo/fn.bar.html + //@ has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo' /// See [foo] pub fn bar() {} } @@ -60,19 +60,19 @@ pub fn bar() {} // This module refers to the outer foo/bar by means of `super::` -// @has foo/subthree/index.html +//@ has foo/subthree/index.html // This module should also refer to the top level foo/bar -// @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.foo.html"]' 'foo' -// @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.bar.html"]' 'bar' +//@ has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.foo.html"]' 'foo' +//@ has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.bar.html"]' 'bar' pub mod subthree { //! See either [foo][super::foo] or [bar][super::bar] } // Next we go *deeper* - In order to ensure it's not just "this or parent" // we test `crate::` and a `super::super::...` chain -// @has foo/subfour/subfive/subsix/subseven/subeight/index.html -// @has - '//section[@id="main-content"]/ul[@class="item-table"]//div[@class="desc docblock-short"]//a[@href="../../../../../subone/fn.foo.html"]' 'other foo' -// @has - '//section[@id="main-content"]/ul[@class="item-table"]//div[@class="desc docblock-short"]//a[@href="../../../../../subtwo/fn.bar.html"]' 'other bar' +//@ has foo/subfour/subfive/subsix/subseven/subeight/index.html +//@ has - '//section[@id="main-content"]/ul[@class="item-table"]//div[@class="desc docblock-short"]//a[@href="../../../../../subone/fn.foo.html"]' 'other foo' +//@ has - '//section[@id="main-content"]/ul[@class="item-table"]//div[@class="desc docblock-short"]//a[@href="../../../../../subtwo/fn.bar.html"]' 'other bar' pub mod subfour { pub mod subfive { pub mod subsix { diff --git a/tests/rustdoc/intra-doc/nested-use.rs b/tests/rustdoc/intra-doc/nested-use.rs index 19ebfff1bce..2aaaed196fd 100644 --- a/tests/rustdoc/intra-doc/nested-use.rs +++ b/tests/rustdoc/intra-doc/nested-use.rs @@ -2,9 +2,9 @@ #![crate_name = "foo"] -// @has foo/struct.Foo.html -// @has - '//a[@href="struct.Foo.html"]' 'Foo' -// @has - '//a[@href="struct.Bar.html"]' 'Bar' +//@ has foo/struct.Foo.html +//@ has - '//a[@href="struct.Foo.html"]' 'Foo' +//@ has - '//a[@href="struct.Bar.html"]' 'Bar' /// [`Foo`] pub use m::{Foo, Bar}; diff --git a/tests/rustdoc/intra-doc/no-doc-primitive.rs b/tests/rustdoc/intra-doc/no-doc-primitive.rs index 711ac09ba9a..1f8622ab867 100644 --- a/tests/rustdoc/intra-doc/no-doc-primitive.rs +++ b/tests/rustdoc/intra-doc/no-doc-primitive.rs @@ -6,7 +6,7 @@ #![rustc_coherence_is_core] #![crate_type = "rlib"] -// @has no_doc_primitive/index.html +//@ has no_doc_primitive/index.html //! A [`char`] and its [`char::len_utf8`]. impl char { pub fn len_utf8(self) -> usize { diff --git a/tests/rustdoc/intra-doc/non-path-primitives.rs b/tests/rustdoc/intra-doc/non-path-primitives.rs index be4b44b3142..88edf12bfb5 100644 --- a/tests/rustdoc/intra-doc/non-path-primitives.rs +++ b/tests/rustdoc/intra-doc/non-path-primitives.rs @@ -2,45 +2,45 @@ #![feature(intra_doc_pointers)] #![deny(rustdoc::broken_intra_doc_links)] -// @has foo/index.html '//a[@href="{{channel}}/std/primitive.slice.html#method.rotate_left"]' 'slice::rotate_left' +//@ has foo/index.html '//a[@href="{{channel}}/std/primitive.slice.html#method.rotate_left"]' 'slice::rotate_left' //! [slice::rotate_left] -// @has - '//a[@href="{{channel}}/std/primitive.array.html#method.map"]' 'array::map' +//@ has - '//a[@href="{{channel}}/std/primitive.array.html#method.map"]' 'array::map' //! [array::map] -// @has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'owned str' -// @has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'str ref' -// @has - '//a[@href="{{channel}}/std/primitive.str.html#method.is_empty"]' 'str::is_empty' -// @has - '//a[@href="{{channel}}/std/primitive.str.html#method.len"]' '&str::len' +//@ has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'owned str' +//@ has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'str ref' +//@ has - '//a[@href="{{channel}}/std/primitive.str.html#method.is_empty"]' 'str::is_empty' +//@ has - '//a[@href="{{channel}}/std/primitive.str.html#method.len"]' '&str::len' //! [owned str][str] //! [str ref][&str] //! [str::is_empty] //! [&str::len] -// @has - '//a[@href="{{channel}}/std/primitive.pointer.html#method.is_null"]' 'pointer::is_null' -// @has - '//a[@href="{{channel}}/std/primitive.pointer.html#method.is_null"]' '*const::is_null' -// @has - '//a[@href="{{channel}}/std/primitive.pointer.html#method.is_null"]' '*mut::is_null' +//@ has - '//a[@href="{{channel}}/std/primitive.pointer.html#method.is_null"]' 'pointer::is_null' +//@ has - '//a[@href="{{channel}}/std/primitive.pointer.html#method.is_null"]' '*const::is_null' +//@ has - '//a[@href="{{channel}}/std/primitive.pointer.html#method.is_null"]' '*mut::is_null' //! [pointer::is_null] //! [*const::is_null] //! [*mut::is_null] -// @has - '//a[@href="{{channel}}/std/primitive.unit.html"]' 'unit' +//@ has - '//a[@href="{{channel}}/std/primitive.unit.html"]' 'unit' //! [unit] -// @has - '//a[@href="{{channel}}/std/primitive.tuple.html"]' 'tuple' +//@ has - '//a[@href="{{channel}}/std/primitive.tuple.html"]' 'tuple' //! [tuple] -// @has - '//a[@href="{{channel}}/std/primitive.reference.html"]' 'reference' -// @has - '//a[@href="{{channel}}/std/primitive.reference.html"]' '&' -// @has - '//a[@href="{{channel}}/std/primitive.reference.html"]' '&mut' +//@ has - '//a[@href="{{channel}}/std/primitive.reference.html"]' 'reference' +//@ has - '//a[@href="{{channel}}/std/primitive.reference.html"]' '&' +//@ has - '//a[@href="{{channel}}/std/primitive.reference.html"]' '&mut' //! [reference] //! [&] //! [&mut] -// @has - '//a[@href="{{channel}}/std/primitive.fn.html"]' 'fn' +//@ has - '//a[@href="{{channel}}/std/primitive.fn.html"]' 'fn' //! [fn] -// @has - '//a[@href="{{channel}}/std/primitive.never.html"]' 'never' -// @has - '//a[@href="{{channel}}/std/primitive.never.html"]' '!' +//@ has - '//a[@href="{{channel}}/std/primitive.never.html"]' 'never' +//@ has - '//a[@href="{{channel}}/std/primitive.never.html"]' '!' //! [never] //! [!] diff --git a/tests/rustdoc/intra-doc/prim-assoc.rs b/tests/rustdoc/intra-doc/prim-assoc.rs index dfa7db8a558..41695205d9d 100644 --- a/tests/rustdoc/intra-doc/prim-assoc.rs +++ b/tests/rustdoc/intra-doc/prim-assoc.rs @@ -1,4 +1,4 @@ #![deny(rustdoc::broken_intra_doc_links)] //! [i32::MAX] -// @has prim_assoc/index.html '//a[@href="{{channel}}/std/primitive.i32.html#associatedconstant.MAX"]' "i32::MAX" +//@ has prim_assoc/index.html '//a[@href="{{channel}}/std/primitive.i32.html#associatedconstant.MAX"]' "i32::MAX" diff --git a/tests/rustdoc/intra-doc/prim-associated-traits.rs b/tests/rustdoc/intra-doc/prim-associated-traits.rs index 71d7d2189e6..41a3931222f 100644 --- a/tests/rustdoc/intra-doc/prim-associated-traits.rs +++ b/tests/rustdoc/intra-doc/prim-associated-traits.rs @@ -1,24 +1,24 @@ #![feature(never_type)] use std::str::FromStr; -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.f64.html#method.from_str"]' 'f64::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.f32.html#method.from_str"]' 'f32::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.isize.html#method.from_str"]' 'isize::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.i8.html#method.from_str"]' 'i8::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.i16.html#method.from_str"]' 'i16::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.i32.html#method.from_str"]' 'i32::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.i64.html#method.from_str"]' 'i64::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.i128.html#method.from_str"]' 'i128::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.usize.html#method.from_str"]' 'usize::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.u8.html#method.from_str"]' 'u8::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.u16.html#method.from_str"]' 'u16::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.u32.html#method.from_str"]' 'u32::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.u64.html#method.from_str"]' 'u64::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.u128.html#method.from_str"]' 'u128::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.char.html#method.from_str"]' 'char::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.bool.html#method.from_str"]' 'bool::from_str()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.str.html#method.eq"]' 'str::eq()' -// @has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.never.html#method.eq"]' 'never::eq()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.f64.html#method.from_str"]' 'f64::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.f32.html#method.from_str"]' 'f32::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.isize.html#method.from_str"]' 'isize::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.i8.html#method.from_str"]' 'i8::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.i16.html#method.from_str"]' 'i16::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.i32.html#method.from_str"]' 'i32::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.i64.html#method.from_str"]' 'i64::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.i128.html#method.from_str"]' 'i128::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.usize.html#method.from_str"]' 'usize::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.u8.html#method.from_str"]' 'u8::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.u16.html#method.from_str"]' 'u16::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.u32.html#method.from_str"]' 'u32::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.u64.html#method.from_str"]' 'u64::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.u128.html#method.from_str"]' 'u128::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.char.html#method.from_str"]' 'char::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.bool.html#method.from_str"]' 'bool::from_str()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.str.html#method.eq"]' 'str::eq()' +//@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.never.html#method.eq"]' 'never::eq()' /// [`f64::from_str()`] [`f32::from_str()`] [`isize::from_str()`] [`i8::from_str()`] /// [`i16::from_str()`] [`i32::from_str()`] [`i64::from_str()`] [`i128::from_str()`] /// [`u16::from_str()`] [`u32::from_str()`] [`u64::from_str()`] [`u128::from_str()`] diff --git a/tests/rustdoc/intra-doc/prim-methods-external-core.rs b/tests/rustdoc/intra-doc/prim-methods-external-core.rs index 76e96d7037f..41a07460b06 100644 --- a/tests/rustdoc/intra-doc/prim-methods-external-core.rs +++ b/tests/rustdoc/intra-doc/prim-methods-external-core.rs @@ -8,9 +8,9 @@ #![no_core] #![crate_type = "rlib"] -// @has prim_methods_external_core/index.html -// @has - '//*[@id="main-content"]//a[@href="../my_core/primitive.char.html"]' 'char' -// @has - '//*[@id="main-content"]//a[@href="../my_core/primitive.char.html#method.len_utf8"]' 'char::len_utf8' +//@ has prim_methods_external_core/index.html +//@ has - '//*[@id="main-content"]//a[@href="../my_core/primitive.char.html"]' 'char' +//@ has - '//*[@id="main-content"]//a[@href="../my_core/primitive.char.html#method.len_utf8"]' 'char::len_utf8' //! A [`char`] and its [`char::len_utf8`]. diff --git a/tests/rustdoc/intra-doc/prim-methods-local.rs b/tests/rustdoc/intra-doc/prim-methods-local.rs index 6de4ec1802f..a9e71c58be3 100644 --- a/tests/rustdoc/intra-doc/prim-methods-local.rs +++ b/tests/rustdoc/intra-doc/prim-methods-local.rs @@ -4,9 +4,9 @@ #![rustc_coherence_is_core] #![crate_type = "rlib"] -// @has prim_methods_local/index.html -// @has - '//*[@id="main-content"]//a[@href="primitive.char.html"]' 'char' -// @has - '//*[@id="main-content"]//a[@href="primitive.char.html#method.len_utf8"]' 'char::len_utf8' +//@ has prim_methods_local/index.html +//@ has - '//*[@id="main-content"]//a[@href="primitive.char.html"]' 'char' +//@ has - '//*[@id="main-content"]//a[@href="primitive.char.html#method.len_utf8"]' 'char::len_utf8' //! A [prim@`char`] and its [`char::len_utf8`]. diff --git a/tests/rustdoc/intra-doc/prim-methods.rs b/tests/rustdoc/intra-doc/prim-methods.rs index bc1965aac55..3ee7eba86ad 100644 --- a/tests/rustdoc/intra-doc/prim-methods.rs +++ b/tests/rustdoc/intra-doc/prim-methods.rs @@ -1,9 +1,9 @@ #![deny(rustdoc::broken_intra_doc_links)] -// @has prim_methods/index.html -// @has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html"]' 'char' -// @has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html"]/@title' 'primitive char' -// @has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html#method.len_utf8"]' 'char::len_utf8' -// @has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html#method.len_utf8"]/@title' 'method char::len_utf8' +//@ has prim_methods/index.html +//@ has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html"]' 'char' +//@ has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html"]/@title' 'primitive char' +//@ has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html#method.len_utf8"]' 'char::len_utf8' +//@ has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.char.html#method.len_utf8"]/@title' 'method char::len_utf8' //! A [`char`] and its [`char::len_utf8`]. diff --git a/tests/rustdoc/intra-doc/prim-precedence.rs b/tests/rustdoc/intra-doc/prim-precedence.rs index c5a64e42a01..56d556e8f1d 100644 --- a/tests/rustdoc/intra-doc/prim-precedence.rs +++ b/tests/rustdoc/intra-doc/prim-precedence.rs @@ -2,15 +2,15 @@ pub mod char { /// [char] - // @has prim_precedence/char/struct.Inner.html '//a/@href' '{{channel}}/std/primitive.char.html' + //@ has prim_precedence/char/struct.Inner.html '//a/@href' '{{channel}}/std/primitive.char.html' pub struct Inner; } /// See [prim@char] -// @has prim_precedence/struct.MyString.html '//a/@href' '{{channel}}/std/primitive.char.html' +//@ has prim_precedence/struct.MyString.html '//a/@href' '{{channel}}/std/primitive.char.html' pub struct MyString; /// See also [crate::char] and [mod@char] -// @has prim_precedence/struct.MyString2.html '//*[@href="char/index.html"]' 'crate::char' -// @has - '//*[@href="char/index.html"]' 'char' +//@ has prim_precedence/struct.MyString2.html '//*[@href="char/index.html"]' 'crate::char' +//@ has - '//*[@href="char/index.html"]' 'char' pub struct MyString2; diff --git a/tests/rustdoc/intra-doc/prim-self.rs b/tests/rustdoc/intra-doc/prim-self.rs index d13858a53cf..d5bfd570d54 100644 --- a/tests/rustdoc/intra-doc/prim-self.rs +++ b/tests/rustdoc/intra-doc/prim-self.rs @@ -10,9 +10,9 @@ /// [Self::f] /// [Self::MAX] -// @has prim_self/primitive.usize.html -// @has - '//a[@href="primitive.usize.html#method.f"]' 'Self::f' -// @has - '//a[@href="primitive.usize.html#associatedconstant.MAX"]' 'Self::MAX' +//@ has prim_self/primitive.usize.html +//@ has - '//a[@href="primitive.usize.html#method.f"]' 'Self::f' +//@ has - '//a[@href="primitive.usize.html#associatedconstant.MAX"]' 'Self::MAX' impl usize { /// Some docs pub fn f() {} @@ -20,7 +20,7 @@ impl usize { /// 10 and 2^32 are basically the same. pub const MAX: usize = 10; - // @has - '//a[@href="primitive.usize.html#associatedtype.ME"]' 'Self::ME' + //@ has - '//a[@href="primitive.usize.html#associatedtype.ME"]' 'Self::ME' /// [Self::ME] pub type ME = usize; } diff --git a/tests/rustdoc/intra-doc/primitive-disambiguators.rs b/tests/rustdoc/intra-doc/primitive-disambiguators.rs index adcab767d0b..1d657b32f8b 100644 --- a/tests/rustdoc/intra-doc/primitive-disambiguators.rs +++ b/tests/rustdoc/intra-doc/primitive-disambiguators.rs @@ -1,4 +1,4 @@ #![deny(rustdoc::broken_intra_doc_links)] -// @has primitive_disambiguators/index.html -// @has - '//a/@href' '{{channel}}/std/primitive.str.html#method.trim' +//@ has primitive_disambiguators/index.html +//@ has - '//a/@href' '{{channel}}/std/primitive.str.html#method.trim' //! [str::trim()] diff --git a/tests/rustdoc/intra-doc/primitive-non-default-impl.rs b/tests/rustdoc/intra-doc/primitive-non-default-impl.rs index 474bf347750..66d82d04d7d 100644 --- a/tests/rustdoc/intra-doc/primitive-non-default-impl.rs +++ b/tests/rustdoc/intra-doc/primitive-non-default-impl.rs @@ -1,31 +1,31 @@ #![deny(rustdoc::broken_intra_doc_links)] -// @has primitive_non_default_impl/fn.str_methods.html +//@ has primitive_non_default_impl/fn.str_methods.html /// [`str::trim`] -// @has - '//*[@href="{{channel}}/std/primitive.str.html#method.trim"]' 'str::trim' +//@ has - '//*[@href="{{channel}}/std/primitive.str.html#method.trim"]' 'str::trim' /// [`str::to_lowercase`] -// @has - '//*[@href="{{channel}}/std/primitive.str.html#method.to_lowercase"]' 'str::to_lowercase' +//@ has - '//*[@href="{{channel}}/std/primitive.str.html#method.to_lowercase"]' 'str::to_lowercase' /// [`str::into_boxed_bytes`] -// @has - '//*[@href="{{channel}}/std/primitive.str.html#method.into_boxed_bytes"]' 'str::into_boxed_bytes' +//@ has - '//*[@href="{{channel}}/std/primitive.str.html#method.into_boxed_bytes"]' 'str::into_boxed_bytes' /// [`str::replace`] -// @has - '//*[@href="{{channel}}/std/primitive.str.html#method.replace"]' 'str::replace' +//@ has - '//*[@href="{{channel}}/std/primitive.str.html#method.replace"]' 'str::replace' pub fn str_methods() {} -// @has primitive_non_default_impl/fn.f32_methods.html +//@ has primitive_non_default_impl/fn.f32_methods.html /// [f32::powi] -// @has - '//*[@href="{{channel}}/std/primitive.f32.html#method.powi"]' 'f32::powi' +//@ has - '//*[@href="{{channel}}/std/primitive.f32.html#method.powi"]' 'f32::powi' /// [f32::sqrt] -// @has - '//*[@href="{{channel}}/std/primitive.f32.html#method.sqrt"]' 'f32::sqrt' +//@ has - '//*[@href="{{channel}}/std/primitive.f32.html#method.sqrt"]' 'f32::sqrt' /// [f32::mul_add] -// @has - '//*[@href="{{channel}}/std/primitive.f32.html#method.mul_add"]' 'f32::mul_add' +//@ has - '//*[@href="{{channel}}/std/primitive.f32.html#method.mul_add"]' 'f32::mul_add' pub fn f32_methods() {} -// @has primitive_non_default_impl/fn.f64_methods.html +//@ has primitive_non_default_impl/fn.f64_methods.html /// [`f64::powi`] -// @has - '//*[@href="{{channel}}/std/primitive.f64.html#method.powi"]' 'f64::powi' +//@ has - '//*[@href="{{channel}}/std/primitive.f64.html#method.powi"]' 'f64::powi' /// [`f64::sqrt`] -// @has - '//*[@href="{{channel}}/std/primitive.f64.html#method.sqrt"]' 'f64::sqrt' +//@ has - '//*[@href="{{channel}}/std/primitive.f64.html#method.sqrt"]' 'f64::sqrt' /// [`f64::mul_add`] -// @has - '//*[@href="{{channel}}/std/primitive.f64.html#method.mul_add"]' 'f64::mul_add' +//@ has - '//*[@href="{{channel}}/std/primitive.f64.html#method.mul_add"]' 'f64::mul_add' pub fn f64_methods() {} diff --git a/tests/rustdoc/intra-doc/private.rs b/tests/rustdoc/intra-doc/private.rs index d1ad210dc31..48d86a30768 100644 --- a/tests/rustdoc/intra-doc/private.rs +++ b/tests/rustdoc/intra-doc/private.rs @@ -7,9 +7,9 @@ #![crate_name = "private"] /// docs [DontDocMe] [DontDocMe::f] [DontDocMe::x] -// @has private/struct.DocMe.html '//*a[@href="struct.DontDocMe.html"]' 'DontDocMe' -// @has private/struct.DocMe.html '//*a[@href="struct.DontDocMe.html#method.f"]' 'DontDocMe::f' -// @has private/struct.DocMe.html '//*a[@href="struct.DontDocMe.html#structfield.x"]' 'DontDocMe::x' +//@ has private/struct.DocMe.html '//*a[@href="struct.DontDocMe.html"]' 'DontDocMe' +//@ has private/struct.DocMe.html '//*a[@href="struct.DontDocMe.html#method.f"]' 'DontDocMe::f' +//@ has private/struct.DocMe.html '//*a[@href="struct.DontDocMe.html#structfield.x"]' 'DontDocMe::x' pub struct DocMe; struct DontDocMe { x: usize, diff --git a/tests/rustdoc/intra-doc/proc-macro.rs b/tests/rustdoc/intra-doc/proc-macro.rs index e7c92259da1..ed18b9dbcfa 100644 --- a/tests/rustdoc/intra-doc/proc-macro.rs +++ b/tests/rustdoc/intra-doc/proc-macro.rs @@ -8,18 +8,18 @@ extern crate proc_macro_macro; pub use proc_macro_macro::{DeriveA, attr_a}; use proc_macro_macro::{DeriveB, attr_b}; -// @has proc_macro/struct.Foo.html -// @has - '//a/@href' 'derive.DeriveA.html' -// @has - '//a/@href' 'attr.attr_a.html' -// @has - '//a/@href' 'trait.DeriveTrait.html' -// @has - '//a/@href' '../proc_macro_macro/derive.DeriveB.html' -// @has - '//a/@href' '../proc_macro_macro/attr.attr_b.html' +//@ has proc_macro/struct.Foo.html +//@ has - '//a/@href' 'derive.DeriveA.html' +//@ has - '//a/@href' 'attr.attr_a.html' +//@ has - '//a/@href' 'trait.DeriveTrait.html' +//@ has - '//a/@href' '../proc_macro_macro/derive.DeriveB.html' +//@ has - '//a/@href' '../proc_macro_macro/attr.attr_b.html' /// Link to [DeriveA], [attr_a], [DeriveB], [attr_b], [DeriveTrait] pub struct Foo; -// @has proc_macro/struct.Bar.html -// @has - '//a/@href' 'derive.DeriveA.html' -// @has - '//a/@href' 'attr.attr_a.html' +//@ has proc_macro/struct.Bar.html +//@ has - '//a/@href' 'derive.DeriveA.html' +//@ has - '//a/@href' 'attr.attr_a.html' /// Link to [deriveA](derive@DeriveA) [attr](macro@attr_a) pub struct Bar; diff --git a/tests/rustdoc/intra-doc/pub-use.rs b/tests/rustdoc/intra-doc/pub-use.rs index f6347ed2eab..7c70adad7d9 100644 --- a/tests/rustdoc/intra-doc/pub-use.rs +++ b/tests/rustdoc/intra-doc/pub-use.rs @@ -5,13 +5,13 @@ extern crate inner; /// [mod@std::env] [g] -// @has outer/index.html -// @has - '//a[@href="{{channel}}/std/env/index.html"]' "std::env" -// @has - '//a[@href="fn.f.html"]' "g" +//@ has outer/index.html +//@ has - '//a[@href="{{channel}}/std/env/index.html"]' "std::env" +//@ has - '//a[@href="fn.f.html"]' "g" pub use f as g; // Make sure the documentation is actually correct by documenting an inlined re-export /// [mod@std::env] -// @has outer/fn.f.html -// @has - '//a[@href="{{channel}}/std/env/index.html"]' "std::env" +//@ has outer/fn.f.html +//@ has - '//a[@href="{{channel}}/std/env/index.html"]' "std::env" pub use inner::f; diff --git a/tests/rustdoc/intra-doc/raw-ident-self.rs b/tests/rustdoc/intra-doc/raw-ident-self.rs index 1ed33db9300..5aecfadb362 100644 --- a/tests/rustdoc/intra-doc/raw-ident-self.rs +++ b/tests/rustdoc/intra-doc/raw-ident-self.rs @@ -4,8 +4,8 @@ pub mod r#impl { impl S { /// See [Self::b]. - // @has raw_ident_self/impl/struct.S.html - // @has - '//a[@href="struct.S.html#method.b"]' 'Self::b' + //@ has raw_ident_self/impl/struct.S.html + //@ has - '//a[@href="struct.S.html#method.b"]' 'Self::b' pub fn a() {} pub fn b() {} diff --git a/tests/rustdoc/intra-doc/reexport-additional-docs.rs b/tests/rustdoc/intra-doc/reexport-additional-docs.rs index 7912fd3681e..1caa109d1fd 100644 --- a/tests/rustdoc/intra-doc/reexport-additional-docs.rs +++ b/tests/rustdoc/intra-doc/reexport-additional-docs.rs @@ -3,19 +3,19 @@ #![crate_name = "foo"] extern crate inner; -// @has foo/struct.Inner.html '//a[@href="fn.with_code.html"]' 'crate::with_code' +//@ has foo/struct.Inner.html '//a[@href="fn.with_code.html"]' 'crate::with_code' /// [crate::with_code] -// @has - '//a[@href="fn.with_code.html"]' 'different text' +//@ has - '//a[@href="fn.with_code.html"]' 'different text' /// [different text][with_code] -// @has - '//a[@href="fn.me_too.html"]' 'me_too' +//@ has - '//a[@href="fn.me_too.html"]' 'me_too' #[doc = "[me_too]"] -// @has - '//a[@href="fn.me_three.html"]' 'reference link' +//@ has - '//a[@href="fn.me_three.html"]' 'reference link' /// This [reference link] #[doc = "has an attr in the way"] /// /// [reference link]: me_three // Should still resolve links from the original module in that scope -// @has - '//a[@href="../inner/fn.f.html"]' 'f()' +//@ has - '//a[@href="../inner/fn.f.html"]' 'f()' pub use inner::Inner; pub fn with_code() {} diff --git a/tests/rustdoc/intra-doc/self-cache.rs b/tests/rustdoc/intra-doc/self-cache.rs index 63bf7fa5768..26cbeb56ad5 100644 --- a/tests/rustdoc/intra-doc/self-cache.rs +++ b/tests/rustdoc/intra-doc/self-cache.rs @@ -1,12 +1,12 @@ #![crate_name = "foo"] -// @has foo/enum.E1.html '//a/@href' 'enum.E1.html#variant.A' +//@ has foo/enum.E1.html '//a/@href' 'enum.E1.html#variant.A' /// [Self::A::b] pub enum E1 { A { b: usize } } -// @has foo/enum.E2.html '//a/@href' 'enum.E2.html#variant.A' +//@ has foo/enum.E2.html '//a/@href' 'enum.E2.html#variant.A' /// [Self::A::b] pub enum E2 { diff --git a/tests/rustdoc/intra-doc/self.rs b/tests/rustdoc/intra-doc/self.rs index 0ba7df8a78a..2c33be781e2 100644 --- a/tests/rustdoc/intra-doc/self.rs +++ b/tests/rustdoc/intra-doc/self.rs @@ -1,8 +1,8 @@ #![crate_name = "foo"] -// @has foo/index.html '//a/@href' 'struct.Foo.html#method.new' -// @has foo/struct.Foo.html '//a/@href' 'struct.Foo.html#method.new' +//@ has foo/index.html '//a/@href' 'struct.Foo.html#method.new' +//@ has foo/struct.Foo.html '//a/@href' 'struct.Foo.html#method.new' /// Use [`new`] to create a new instance. /// @@ -15,8 +15,8 @@ impl Foo { } } -// @has foo/index.html '//a/@href' 'struct.Bar.html#method.new2' -// @has foo/struct.Bar.html '//a/@href' 'struct.Bar.html#method.new2' +//@ has foo/index.html '//a/@href' 'struct.Bar.html#method.new2' +//@ has foo/struct.Bar.html '//a/@href' 'struct.Bar.html#method.new2' /// Use [`new2`] to create a new instance. /// @@ -30,7 +30,7 @@ impl Bar { } pub struct MyStruct { - // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#structfield.struct_field' + //@ has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#structfield.struct_field' /// [`struct_field`] /// @@ -39,7 +39,7 @@ pub struct MyStruct { } pub enum MyEnum { - // @has foo/enum.MyEnum.html '//a/@href' 'enum.MyEnum.html#variant.EnumVariant' + //@ has foo/enum.MyEnum.html '//a/@href' 'enum.MyEnum.html#variant.EnumVariant' /// [`EnumVariant`] /// @@ -48,7 +48,7 @@ pub enum MyEnum { } pub union MyUnion { - // @has foo/union.MyUnion.html '//a/@href' 'union.MyUnion.html#structfield.union_field' + //@ has foo/union.MyUnion.html '//a/@href' 'union.MyUnion.html#structfield.union_field' /// [`union_field`] /// @@ -57,21 +57,21 @@ pub union MyUnion { } pub trait MyTrait { - // @has foo/trait.MyTrait.html '//a/@href' 'trait.MyTrait.html#associatedtype.AssoType' + //@ has foo/trait.MyTrait.html '//a/@href' 'trait.MyTrait.html#associatedtype.AssoType' /// [`AssoType`] /// /// [`AssoType`]: Self::AssoType type AssoType; - // @has foo/trait.MyTrait.html '//a/@href' 'trait.MyTrait.html#associatedconstant.ASSO_CONST' + //@ has foo/trait.MyTrait.html '//a/@href' 'trait.MyTrait.html#associatedconstant.ASSO_CONST' /// [`ASSO_CONST`] /// /// [`ASSO_CONST`]: Self::ASSO_CONST const ASSO_CONST: i32 = 1; - // @has foo/trait.MyTrait.html '//a/@href' 'trait.MyTrait.html#method.asso_fn' + //@ has foo/trait.MyTrait.html '//a/@href' 'trait.MyTrait.html#method.asso_fn' /// [`asso_fn`] /// @@ -80,7 +80,7 @@ pub trait MyTrait { } impl MyStruct { - // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#method.for_impl' + //@ has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#method.for_impl' /// [`for_impl`] /// @@ -91,21 +91,21 @@ impl MyStruct { } impl MyTrait for MyStruct { - // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedtype.AssoType' + //@ has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedtype.AssoType' /// [`AssoType`] /// /// [`AssoType`]: Self::AssoType type AssoType = u32; - // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedconstant.ASSO_CONST' + //@ has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedconstant.ASSO_CONST' /// [`ASSO_CONST`] /// /// [`ASSO_CONST`]: Self::ASSO_CONST const ASSO_CONST: i32 = 10; - // @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#method.asso_fn' + //@ has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#method.asso_fn' /// [`asso_fn`] /// diff --git a/tests/rustdoc/intra-doc/trait-impl.rs b/tests/rustdoc/intra-doc/trait-impl.rs index cf60dc1dbd5..925a63187f4 100644 --- a/tests/rustdoc/intra-doc/trait-impl.rs +++ b/tests/rustdoc/intra-doc/trait-impl.rs @@ -5,21 +5,21 @@ pub struct MyStruct; impl MyTrait for MyStruct { -// @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedtype.AssoType' +//@ has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedtype.AssoType' /// [`AssoType`] /// /// [`AssoType`]: MyStruct::AssoType type AssoType = u32; -// @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedconstant.ASSO_CONST' +//@ has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#associatedconstant.ASSO_CONST' /// [`ASSO_CONST`] /// /// [`ASSO_CONST`]: MyStruct::ASSO_CONST const ASSO_CONST: i32 = 10; -// @has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#method.trait_fn' +//@ has foo/struct.MyStruct.html '//a/@href' 'struct.MyStruct.html#method.trait_fn' /// [`trait_fn`] /// diff --git a/tests/rustdoc/intra-doc/trait-item.rs b/tests/rustdoc/intra-doc/trait-item.rs index e95dba33b5f..2563a768cc3 100644 --- a/tests/rustdoc/intra-doc/trait-item.rs +++ b/tests/rustdoc/intra-doc/trait-item.rs @@ -2,8 +2,8 @@ /// Link to [S::assoc_fn()] /// Link to [Default::default()] -// @has trait_item/struct.S.html '//*[@href="struct.S.html#method.assoc_fn"]' 'S::assoc_fn()' -// @has - '//*[@href="{{channel}}/core/default/trait.Default.html#tymethod.default"]' 'Default::default()' +//@ has trait_item/struct.S.html '//*[@href="struct.S.html#method.assoc_fn"]' 'S::assoc_fn()' +//@ has - '//*[@href="{{channel}}/core/default/trait.Default.html#tymethod.default"]' 'Default::default()' pub struct S; impl S { diff --git a/tests/rustdoc/intra-doc/true-false.rs b/tests/rustdoc/intra-doc/true-false.rs index e02be9cabd2..ce38ee11d5c 100644 --- a/tests/rustdoc/intra-doc/true-false.rs +++ b/tests/rustdoc/intra-doc/true-false.rs @@ -1,8 +1,8 @@ #![deny(rustdoc::broken_intra_doc_links)] #![crate_name = "foo"] -// @has foo/index.html -// @has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.bool.html"]' 'true' -// @has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.bool.html"]' 'false' +//@ has foo/index.html +//@ has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.bool.html"]' 'true' +//@ has - '//*[@id="main-content"]//a[@href="{{channel}}/std/primitive.bool.html"]' 'false' //! A `bool` is either [`true`] or [`false`]. diff --git a/tests/rustdoc/intra-doc/type-alias.rs b/tests/rustdoc/intra-doc/type-alias.rs index 6c52082a277..43e27483445 100644 --- a/tests/rustdoc/intra-doc/type-alias.rs +++ b/tests/rustdoc/intra-doc/type-alias.rs @@ -15,5 +15,5 @@ impl Bar { /// The minimum is [`Self::MIN`]. pub type Int = i32; -// @has foo/type.Bar.html '//a[@href="struct.Foo.html#method.bar"]' 'Self::bar' -// @has foo/type.Int.html '//a[@href="{{channel}}/std/primitive.i32.html#associatedconstant.MIN"]' 'Self::MIN' +//@ has foo/type.Bar.html '//a[@href="struct.Foo.html#method.bar"]' 'Self::bar' +//@ has foo/type.Int.html '//a[@href="{{channel}}/std/primitive.i32.html#associatedconstant.MIN"]' 'Self::MIN' diff --git a/tests/rustdoc/issue-100204-inline-impl-through-glob-import.rs b/tests/rustdoc/issue-100204-inline-impl-through-glob-import.rs index 95fd3c12d6f..7f05e57ec09 100644 --- a/tests/rustdoc/issue-100204-inline-impl-through-glob-import.rs +++ b/tests/rustdoc/issue-100204-inline-impl-through-glob-import.rs @@ -8,7 +8,7 @@ extern crate first; pub mod prelude {} -// @has first/struct.Bot.html '//h4[@class="code-header"]' 'pub fn new() -> Bot' -// @has second/struct.Bot.html '//h4[@class="code-header"]' 'pub fn new() -> Bot' +//@ has first/struct.Bot.html '//h4[@class="code-header"]' 'pub fn new() -> Bot' +//@ has second/struct.Bot.html '//h4[@class="code-header"]' 'pub fn new() -> Bot' #[doc(inline)] pub use first::*; diff --git a/tests/rustdoc/issue-101743-bold-tag.rs b/tests/rustdoc/issue-101743-bold-tag.rs index 631181fec66..a81767eeeeb 100644 --- a/tests/rustdoc/issue-101743-bold-tag.rs +++ b/tests/rustdoc/issue-101743-bold-tag.rs @@ -14,6 +14,6 @@ impl Repr { // If we change back to rendering the value of consts, check this doesn't add // a tag, but escapes correctly - // @has foo/struct.Repr.html '//section[@id="associatedconstant.BASE"]/h4' '= _' + //@ has foo/struct.Repr.html '//section[@id="associatedconstant.BASE"]/h4' '= _' pub const BASE: IBig = base_as_ibig::(); } diff --git a/tests/rustdoc/issue-105735-overlapping-reexport-2.rs b/tests/rustdoc/issue-105735-overlapping-reexport-2.rs index 2905e7d44bc..946184c5a04 100644 --- a/tests/rustdoc/issue-105735-overlapping-reexport-2.rs +++ b/tests/rustdoc/issue-105735-overlapping-reexport-2.rs @@ -3,13 +3,13 @@ #![crate_name = "foo"] #![no_std] -// @has 'foo/index.html' -// @has - '//*[@class="item-name"]/a[@class="type"]' 'AtomicU8' -// @has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8' +//@ has 'foo/index.html' +//@ has - '//*[@class="item-name"]/a[@class="type"]' 'AtomicU8' +//@ has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8' // We also ensure we don't have another item displayed. -// @count - '//*[@id="main-content"]/*[@class="section-header"]' 2 -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Type Aliases' -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants' +//@ count - '//*[@id="main-content"]/*[@class="section-header"]' 2 +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Type Aliases' +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants' mod other { pub type AtomicU8 = (); diff --git a/tests/rustdoc/issue-105735-overlapping-reexport.rs b/tests/rustdoc/issue-105735-overlapping-reexport.rs index 7fa7df7701a..0fd17fd9577 100644 --- a/tests/rustdoc/issue-105735-overlapping-reexport.rs +++ b/tests/rustdoc/issue-105735-overlapping-reexport.rs @@ -3,13 +3,13 @@ #![crate_name = "foo"] #![no_std] -// @has 'foo/index.html' -// @has - '//*[@class="item-name"]/a[@class="struct"]' 'AtomicU8' -// @has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8' +//@ has 'foo/index.html' +//@ has - '//*[@class="item-name"]/a[@class="struct"]' 'AtomicU8' +//@ has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8' // We also ensure we don't have another item displayed. -// @count - '//*[@id="main-content"]/*[@class="section-header"]' 2 -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs' -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants' +//@ count - '//*[@id="main-content"]/*[@class="section-header"]' 2 +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs' +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants' mod thing { pub use core::sync::atomic::AtomicU8; diff --git a/tests/rustdoc/issue-105952.rs b/tests/rustdoc/issue-105952.rs index e3f1df0063d..173efb82f4b 100644 --- a/tests/rustdoc/issue-105952.rs +++ b/tests/rustdoc/issue-105952.rs @@ -9,6 +9,6 @@ pub trait Parse { } pub trait RenderRaw {} -// @hasraw foo/trait.RenderRaw.html 'impl' -// @hasraw foo/trait.RenderRaw.html 'ParseMode::Raw' +//@ hasraw foo/trait.RenderRaw.html 'impl' +//@ hasraw foo/trait.RenderRaw.html 'ParseMode::Raw' impl> RenderRaw for T {} diff --git a/tests/rustdoc/issue-106142.rs b/tests/rustdoc/issue-106142.rs index 41505e72405..52adc5dbbf1 100644 --- a/tests/rustdoc/issue-106142.rs +++ b/tests/rustdoc/issue-106142.rs @@ -1,5 +1,5 @@ -// @has 'issue_106142/a/index.html' -// @count 'issue_106142/a/index.html' '//ul[@class="item-table"]//li//a' 1 +//@ has 'issue_106142/a/index.html' +//@ count 'issue_106142/a/index.html' '//ul[@class="item-table"]//li//a' 1 #![allow(rustdoc::broken_intra_doc_links)] diff --git a/tests/rustdoc/issue-106421-not-internal.rs b/tests/rustdoc/issue-106421-not-internal.rs index 1d744fba53f..f328a1036eb 100644 --- a/tests/rustdoc/issue-106421-not-internal.rs +++ b/tests/rustdoc/issue-106421-not-internal.rs @@ -4,5 +4,5 @@ // In this case, the item shouldn't be documented, because regular users can't get at it. extern crate foo; -// @!has issue_106421_not_internal/struct.FatalError.html '//*[@id="method.raise"]' 'fn raise' +//@ !has issue_106421_not_internal/struct.FatalError.html '//*[@id="method.raise"]' 'fn raise' pub use foo::FatalError; diff --git a/tests/rustdoc/issue-106421.rs b/tests/rustdoc/issue-106421.rs index d4141a4ab0c..c2064c71090 100644 --- a/tests/rustdoc/issue-106421.rs +++ b/tests/rustdoc/issue-106421.rs @@ -4,5 +4,5 @@ extern crate foo; -// @has issue_106421/struct.FatalError.html '//*[@id="method.raise"]' 'fn raise' +//@ has issue_106421/struct.FatalError.html '//*[@id="method.raise"]' 'fn raise' pub use foo::FatalError; diff --git a/tests/rustdoc/issue-107350.rs b/tests/rustdoc/issue-107350.rs index 75f378ed249..4ec9133e2d2 100644 --- a/tests/rustdoc/issue-107350.rs +++ b/tests/rustdoc/issue-107350.rs @@ -3,7 +3,7 @@ #![crate_name = "foo"] -// @has 'foo/oops/enum.OhNo.html' +//@ has 'foo/oops/enum.OhNo.html' pub mod oops { pub use crate::oops::OhNo; diff --git a/tests/rustdoc/issue-107995.rs b/tests/rustdoc/issue-107995.rs index 1273e4fdd12..57669909aa1 100644 --- a/tests/rustdoc/issue-107995.rs +++ b/tests/rustdoc/issue-107995.rs @@ -2,26 +2,26 @@ #![crate_name = "foo"] -// @has 'foo/fn.foo.html' -// @has - '//*[@class="docblock"]//a[@href="fn.bar.html"]' 'bar`' +//@ has 'foo/fn.foo.html' +//@ has - '//*[@class="docblock"]//a[@href="fn.bar.html"]' 'bar`' /// A foo, see also [ bar`] pub fn foo() {} -// @has 'foo/fn.bar.html' -// @has - '//*[@class="docblock"]' 'line Path line' -// @has - '//*[@class="docblock"]//a[@href="struct.Path.html"]' 'Path' +//@ has 'foo/fn.bar.html' +//@ has - '//*[@class="docblock"]' 'line Path line' +//@ has - '//*[@class="docblock"]//a[@href="struct.Path.html"]' 'Path' #[doc = "line ["] #[doc = "Path"] #[doc = "] line"] pub fn bar() {} -// @has 'foo/fn.another.html' -// @has - '//*[@class="docblock"]//a[@href="struct.Path.html"]' 'Path' +//@ has 'foo/fn.another.html' +//@ has - '//*[@class="docblock"]//a[@href="struct.Path.html"]' 'Path' /// [ `Path`] pub fn another() {} -// @has 'foo/fn.last.html' -// @has - '//*[@class="docblock"]//a[@href="struct.Path.html"]' 'Path' +//@ has 'foo/fn.last.html' +//@ has - '//*[@class="docblock"]//a[@href="struct.Path.html"]' 'Path' /// [ Path`] pub fn last() {} diff --git a/tests/rustdoc/issue-108231.rs b/tests/rustdoc/issue-108231.rs index 684f0494fd5..0d3ad1b0571 100644 --- a/tests/rustdoc/issue-108231.rs +++ b/tests/rustdoc/issue-108231.rs @@ -4,9 +4,9 @@ #![crate_name = "foo"] -// @has 'foo/index.html' -// @count - '//*[@id="main-content"]//a[@class="macro"]' 1 -// @has - '//*[@id="main-content"]//a[@class="macro"]' 'foo' +//@ has 'foo/index.html' +//@ count - '//*[@id="main-content"]//a[@class="macro"]' 1 +//@ has - '//*[@id="main-content"]//a[@class="macro"]' 'foo' #[doc(hidden)] pub mod __internal { diff --git a/tests/rustdoc/issue-108281.rs b/tests/rustdoc/issue-108281.rs index 8e1b6ba88a6..ba6c570b59b 100644 --- a/tests/rustdoc/issue-108281.rs +++ b/tests/rustdoc/issue-108281.rs @@ -3,7 +3,7 @@ #![crate_name = "foo"] -// @has 'foo/index.html' +//@ has 'foo/index.html' #[doc(hidden)] pub fn bar() {} @@ -11,15 +11,15 @@ mod sub { pub fn public() {} } -// @matches - '//*[@class="desc docblock-short"]' '^Displayed$' +//@ matches - '//*[@class="desc docblock-short"]' '^Displayed$' /// Displayed #[doc(inline)] pub use crate::bar as Bar; -// @matches - '//*[@class="desc docblock-short"]' '^Hello\sDisplayed$' +//@ matches - '//*[@class="desc docblock-short"]' '^Hello\sDisplayed$' #[doc(inline)] /// Hello pub use crate::Bar as Bar2; -// @matches - '//*[@class="desc docblock-short"]' '^Public$' +//@ matches - '//*[@class="desc docblock-short"]' '^Public$' /// Public pub use crate::sub::public as Public; diff --git a/tests/rustdoc/issue-108679-reexport-of-reexport.rs b/tests/rustdoc/issue-108679-reexport-of-reexport.rs index 5f977801cfd..5c1b4bcbd83 100644 --- a/tests/rustdoc/issue-108679-reexport-of-reexport.rs +++ b/tests/rustdoc/issue-108679-reexport-of-reexport.rs @@ -5,12 +5,12 @@ #![crate_name = "foo"] pub mod a { - // @has 'foo/a/index.html' + //@ has 'foo/a/index.html' // Should only contain "Structs". - // @count - '//*[@id="main-content"]//*[@class="item-table"]' 1 - // @has - '//*[@id="structs"]' 'Structs' - // @has - '//*[@id="main-content"]//a[@href="struct.A.html"]' 'A' - // @has - '//*[@id="main-content"]//a[@href="struct.B.html"]' 'B' + //@ count - '//*[@id="main-content"]//*[@class="item-table"]' 1 + //@ has - '//*[@id="structs"]' 'Structs' + //@ has - '//*[@id="main-content"]//a[@href="struct.A.html"]' 'A' + //@ has - '//*[@id="main-content"]//a[@href="struct.B.html"]' 'B' mod b { pub struct B; } @@ -18,12 +18,12 @@ pub mod a { pub struct A; } -// @has 'foo/index.html' -// @!has - '//*[@id="structs"]' 'Structs' -// @has - '//*[@id="reexports"]' 'Re-exports' -// @has - '//*[@id="modules"]' 'Modules' -// @has - '//*[@id="main-content"]//*[@id="reexport.A"]' 'pub use self::a::A;' -// @has - '//*[@id="main-content"]//*[@id="reexport.B"]' 'pub use self::a::B;' +//@ has 'foo/index.html' +//@ !has - '//*[@id="structs"]' 'Structs' +//@ has - '//*[@id="reexports"]' 'Re-exports' +//@ has - '//*[@id="modules"]' 'Modules' +//@ has - '//*[@id="main-content"]//*[@id="reexport.A"]' 'pub use self::a::A;' +//@ has - '//*[@id="main-content"]//*[@id="reexport.B"]' 'pub use self::a::B;' // Should only contain "Modules" and "Re-exports". -// @count - '//*[@id="main-content"]//*[@class="item-table"]' 2 +//@ count - '//*[@id="main-content"]//*[@class="item-table"]' 2 pub use self::a::{A, B}; diff --git a/tests/rustdoc/issue-108925.rs b/tests/rustdoc/issue-108925.rs index 9c36d0d71c4..a332771616d 100644 --- a/tests/rustdoc/issue-108925.rs +++ b/tests/rustdoc/issue-108925.rs @@ -1,7 +1,7 @@ -// @has issue_108925/enum.MyThing.html -// @has - '//code' 'Shown' -// @!has - '//code' 'NotShown' -// @!has - '//code' '// some variants omitted' +//@ has issue_108925/enum.MyThing.html +//@ has - '//code' 'Shown' +//@ !has - '//code' 'NotShown' +//@ !has - '//code' '// some variants omitted' #[non_exhaustive] pub enum MyThing { Shown, diff --git a/tests/rustdoc/issue-108931-anonymous-reexport.rs b/tests/rustdoc/issue-108931-anonymous-reexport.rs index 302f7413398..300ee3baf05 100644 --- a/tests/rustdoc/issue-108931-anonymous-reexport.rs +++ b/tests/rustdoc/issue-108931-anonymous-reexport.rs @@ -10,12 +10,12 @@ mod bar { pub struct Bar; } -// @has 'foo/index.html' +//@ has 'foo/index.html' // We check that the only "h2" present are "Re-exports" and "Modules". -// @count - '//*[@id="main-content"]/h2' 2 -// @has - '//*[@id="main-content"]/h2' 'Re-exports' -// @has - '//*[@id="main-content"]/h2' 'Modules' -// @has - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 'pub use foo::Foo as _;' -// @has - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 'pub use bar::Bar as _;' +//@ count - '//*[@id="main-content"]/h2' 2 +//@ has - '//*[@id="main-content"]/h2' 'Re-exports' +//@ has - '//*[@id="main-content"]/h2' 'Modules' +//@ has - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 'pub use foo::Foo as _;' +//@ has - '//*[@id="main-content"]//*[@class="item-table"]//li//code' 'pub use bar::Bar as _;' pub use foo::Foo as _; pub use bar::Bar as _; diff --git a/tests/rustdoc/issue-109258-missing-private-inlining.rs b/tests/rustdoc/issue-109258-missing-private-inlining.rs index 12c5556f132..7f010f160c4 100644 --- a/tests/rustdoc/issue-109258-missing-private-inlining.rs +++ b/tests/rustdoc/issue-109258-missing-private-inlining.rs @@ -2,23 +2,23 @@ #![crate_name = "foo"] -// @has 'foo/index.html' +//@ has 'foo/index.html' // We should only have a "Re-exports" and a "Modules" headers. -// @count - '//*[@id="main-content"]/h2[@class="section-header"]' 2 -// @has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Re-exports' -// @has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Modules' +//@ count - '//*[@id="main-content"]/h2[@class="section-header"]' 2 +//@ has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Re-exports' +//@ has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Modules' -// @has - '//*[@id="reexport.Foo"]' 'pub use crate::issue_109258::Foo;' -// @has - '//*[@id="reexport.Foo"]//a[@href="issue_109258/struct.Foo.html"]' 'Foo' -// @!has 'foo/struct.Foo.html' +//@ has - '//*[@id="reexport.Foo"]' 'pub use crate::issue_109258::Foo;' +//@ has - '//*[@id="reexport.Foo"]//a[@href="issue_109258/struct.Foo.html"]' 'Foo' +//@ !has 'foo/struct.Foo.html' pub use crate::issue_109258::Foo; -// @has 'foo/issue_109258/index.html' +//@ has 'foo/issue_109258/index.html' // We should only have a "Structs" header. -// @count - '//*[@id="main-content"]/h2[@class="section-header"]' 1 -// @has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Structs' -// @has - '//*[@id="main-content"]//a[@href="struct.Foo.html"]' 'Foo' -// @has 'foo/issue_109258/struct.Foo.html' +//@ count - '//*[@id="main-content"]/h2[@class="section-header"]' 1 +//@ has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Structs' +//@ has - '//*[@id="main-content"]//a[@href="struct.Foo.html"]' 'Foo' +//@ has 'foo/issue_109258/struct.Foo.html' pub mod issue_109258 { mod priv_mod { pub struct Foo; diff --git a/tests/rustdoc/issue-109449-doc-hidden-reexports.rs b/tests/rustdoc/issue-109449-doc-hidden-reexports.rs index 9fb2f7c7c05..cc3679f6196 100644 --- a/tests/rustdoc/issue-109449-doc-hidden-reexports.rs +++ b/tests/rustdoc/issue-109449-doc-hidden-reexports.rs @@ -23,75 +23,75 @@ pub struct FooFoo; // Checking that re-exporting a `#[doc(hidden)]` item will NOT inline it. pub mod single_reexport { - // @has 'foo/single_reexport/index.html' + //@ has 'foo/single_reexport/index.html' // First we check that we have 4 type aliases. - // @count - '//*[@id="main-content"]/*[@class="item-table"]//code' 4 + //@ count - '//*[@id="main-content"]/*[@class="item-table"]//code' 4 // Then we check that we have the correct link for each re-export. - // @!has - '//*[@href="struct.Foo.html"]' 'Foo' - // @has - '//*[@id="reexport.Foo"]/code' 'pub use crate::private_module::Public as Foo;' + //@ !has - '//*[@href="struct.Foo.html"]' 'Foo' + //@ has - '//*[@id="reexport.Foo"]/code' 'pub use crate::private_module::Public as Foo;' pub use crate::private_module::Public as Foo; - // @!has - '//*[@href="type.Foo2.html"]' 'Foo2' - // @has - '//*[@id="reexport.Foo2"]/code' 'pub use crate::private_module::Bar as Foo2;' + //@ !has - '//*[@href="type.Foo2.html"]' 'Foo2' + //@ has - '//*[@id="reexport.Foo2"]/code' 'pub use crate::private_module::Bar as Foo2;' pub use crate::private_module::Bar as Foo2; - // @!has - '//*[@href="type.Yo.html"]' 'Yo' - // @has - '//*[@id="reexport.Yo"]/code' 'pub use crate::Bar3 as Yo;' + //@ !has - '//*[@href="type.Yo.html"]' 'Yo' + //@ has - '//*[@id="reexport.Yo"]/code' 'pub use crate::Bar3 as Yo;' pub use crate::Bar3 as Yo; - // @!has - '//*[@href="struct.Yo2.html"]' 'Yo2' - // @has - '//*[@id="reexport.Yo2"]/code' 'pub use crate::FooFoo as Yo2;' + //@ !has - '//*[@href="struct.Yo2.html"]' 'Yo2' + //@ has - '//*[@id="reexport.Yo2"]/code' 'pub use crate::FooFoo as Yo2;' pub use crate::FooFoo as Yo2; // Checking that each file is also created as expected. - // @!has 'foo/single_reexport/struct.Foo.html' - // @!has 'foo/single_reexport/type.Foo2.html' - // @!has 'foo/single_reexport/type.Yo.html' - // @!has 'foo/single_reexport/struct.Yo2.html' + //@ !has 'foo/single_reexport/struct.Foo.html' + //@ !has 'foo/single_reexport/type.Foo2.html' + //@ !has 'foo/single_reexport/type.Yo.html' + //@ !has 'foo/single_reexport/struct.Yo2.html' } // However, re-exporting an item inheriting `#[doc(hidden)]` will inline it. pub mod single_reexport_inherit_hidden { - // @has 'foo/single_reexport_inherit_hidden/index.html' + //@ has 'foo/single_reexport_inherit_hidden/index.html' - // @has - '//*[@href="struct.Foo3.html"]' 'Foo3' + //@ has - '//*[@href="struct.Foo3.html"]' 'Foo3' pub use crate::module::Public2 as Foo3; - // @has - '//*[@href="type.Foo4.html"]' 'Foo4' + //@ has - '//*[@href="type.Foo4.html"]' 'Foo4' pub use crate::module::Bar2 as Foo4; - // @has 'foo/single_reexport_inherit_hidden/struct.Foo3.html' - // @has 'foo/single_reexport_inherit_hidden/type.Foo4.html' + //@ has 'foo/single_reexport_inherit_hidden/struct.Foo3.html' + //@ has 'foo/single_reexport_inherit_hidden/type.Foo4.html' } pub mod single_reexport_no_inline { // First we ensure that we only have re-exports and no inlined items. - // @has 'foo/single_reexport_no_inline/index.html' - // @count - '//*[@id="main-content"]/*[@class="section-header"]' 1 - // @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Re-exports' + //@ has 'foo/single_reexport_no_inline/index.html' + //@ count - '//*[@id="main-content"]/*[@class="section-header"]' 1 + //@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Re-exports' // Now we check that we don't have links to the items, just `pub use`. - // @has - '//*[@id="main-content"]//*' 'pub use crate::private_module::Public as XFoo;' - // @!has - '//*[@id="main-content"]//a' 'XFoo' + //@ has - '//*[@id="main-content"]//*' 'pub use crate::private_module::Public as XFoo;' + //@ !has - '//*[@id="main-content"]//a' 'XFoo' #[doc(no_inline)] pub use crate::private_module::Public as XFoo; - // @has - '//*[@id="main-content"]//*' 'pub use crate::private_module::Bar as Foo2;' - // @!has - '//*[@id="main-content"]//a' 'Foo2' + //@ has - '//*[@id="main-content"]//*' 'pub use crate::private_module::Bar as Foo2;' + //@ !has - '//*[@id="main-content"]//a' 'Foo2' #[doc(no_inline)] pub use crate::private_module::Bar as Foo2; - // @has - '//*[@id="main-content"]//*' 'pub use crate::Bar3 as Yo;' - // @!has - '//*[@id="main-content"]//a' 'Yo' + //@ has - '//*[@id="main-content"]//*' 'pub use crate::Bar3 as Yo;' + //@ !has - '//*[@id="main-content"]//a' 'Yo' #[doc(no_inline)] pub use crate::Bar3 as Yo; - // @has - '//*[@id="main-content"]//*' 'pub use crate::FooFoo as Yo2;' - // @!has - '//*[@id="main-content"]//a' 'Yo2' + //@ has - '//*[@id="main-content"]//*' 'pub use crate::FooFoo as Yo2;' + //@ !has - '//*[@id="main-content"]//a' 'Yo2' #[doc(no_inline)] pub use crate::FooFoo as Yo2; - // @has - '//*[@id="main-content"]//*' 'pub use crate::module::Public2 as Foo3;' - // @!has - '//*[@id="main-content"]//a' 'Foo3' + //@ has - '//*[@id="main-content"]//*' 'pub use crate::module::Public2 as Foo3;' + //@ !has - '//*[@id="main-content"]//a' 'Foo3' #[doc(no_inline)] pub use crate::module::Public2 as Foo3; - // @has - '//*[@id="main-content"]//*' 'pub use crate::module::Bar2 as Foo4;' - // @!has - '//*[@id="main-content"]//a' 'Foo4' + //@ has - '//*[@id="main-content"]//*' 'pub use crate::module::Bar2 as Foo4;' + //@ !has - '//*[@id="main-content"]//a' 'Foo4' #[doc(no_inline)] pub use crate::module::Bar2 as Foo4; } @@ -100,25 +100,25 @@ pub mod single_reexport_no_inline { pub mod glob_reexport { // With glob re-exports, we don't inline `#[doc(hidden)]` items so only `module` items // should be inlined. - // @has 'foo/glob_reexport/index.html' - // @count - '//*[@id="main-content"]/*[@class="section-header"]' 3 - // @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Re-exports' - // @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs' - // @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Type Aliases' + //@ has 'foo/glob_reexport/index.html' + //@ count - '//*[@id="main-content"]/*[@class="section-header"]' 3 + //@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Re-exports' + //@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs' + //@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Type Aliases' // Now we check we have 1 re-export and 2 inlined items. // If not item from a glob re-export is visible, we don't show the re-export. - // @!has - '//*[@id="main-content"]//*' 'pub use crate::private_module::*;' + //@ !has - '//*[@id="main-content"]//*' 'pub use crate::private_module::*;' pub use crate::private_module::*; - // @has - '//*[@id="main-content"]//*' 'pub use crate::*;' + //@ has - '//*[@id="main-content"]//*' 'pub use crate::*;' pub use crate::*; // This one should be inlined. - // @!has - '//*[@id="main-content"]//*' 'pub use crate::module::*;' - // @has - '//*[@id="main-content"]//a[@href="struct.Public2.html"]' 'Public2' - // @has - '//*[@id="main-content"]//a[@href="type.Bar2.html"]' 'Bar2' + //@ !has - '//*[@id="main-content"]//*' 'pub use crate::module::*;' + //@ has - '//*[@id="main-content"]//a[@href="struct.Public2.html"]' 'Public2' + //@ has - '//*[@id="main-content"]//a[@href="type.Bar2.html"]' 'Bar2' // And we check that the two files were created too. - // @has 'foo/glob_reexport/struct.Public2.html' - // @has 'foo/glob_reexport/type.Bar2.html' + //@ has 'foo/glob_reexport/struct.Public2.html' + //@ has 'foo/glob_reexport/type.Bar2.html' pub use crate::module::*; } @@ -129,12 +129,12 @@ mod private { // Checking that `#[doc(hidden)]` re-exports documentation isn't generated. pub mod doc_hidden_reexport { - // @has 'foo/doc_hidden_reexport/index.html' + //@ has 'foo/doc_hidden_reexport/index.html' // Ensure there is only one item in this page and that it's a struct. - // @count - '//*[@class="item-name"]' 1 - // @has - '//a[@class="struct"]' 'Reexport' + //@ count - '//*[@class="item-name"]' 1 + //@ has - '//a[@class="struct"]' 'Reexport' // Check that the `#[doc(hidden)]` re-export's attributes are not taken into account. - // @has - '//*[@class="desc docblock-short"]' 'Visible. Original.' + //@ has - '//*[@class="desc docblock-short"]' 'Visible. Original.' /// Visible. pub use self::Bar3 as Reexport; /// Hidden. diff --git a/tests/rustdoc/issue-109695-crate-doc-hidden.rs b/tests/rustdoc/issue-109695-crate-doc-hidden.rs index 7a3e53a0d32..8dc077d1565 100644 --- a/tests/rustdoc/issue-109695-crate-doc-hidden.rs +++ b/tests/rustdoc/issue-109695-crate-doc-hidden.rs @@ -1,8 +1,8 @@ // This test ensures that even if the crate module is `#[doc(hidden)]`, the file // is generated. -// @has 'foo/index.html' -// @has 'foo/all.html' +//@ has 'foo/index.html' +//@ has 'foo/all.html' #![crate_name = "foo"] #![doc(hidden)] diff --git a/tests/rustdoc/issue-110422-inner-private.rs b/tests/rustdoc/issue-110422-inner-private.rs index ca9ec70aaa4..31e28676879 100644 --- a/tests/rustdoc/issue-110422-inner-private.rs +++ b/tests/rustdoc/issue-110422-inner-private.rs @@ -6,22 +6,22 @@ #![crate_name = "foo"] -// @has 'foo/index.html' +//@ has 'foo/index.html' // Checking there is no "trait" entry. -// @count - '//*[@id="main-content"]/*[@class="section-header"]' 4 -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs' -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants' -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Functions' -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Macros' +//@ count - '//*[@id="main-content"]/*[@class="section-header"]' 4 +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs' +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants' +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Functions' +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Macros' -// @has - '//a[@href="fn.foo.html"]' 'foo' +//@ has - '//a[@href="fn.foo.html"]' 'foo' fn foo() { fn bar() {} - // @has - '//a[@class="macro"]' 'visible_macro' - // @!has - '//a[@class="macro"]' 'non_visible_macro' - // @has 'foo/macro.visible_macro.html' - // @!has 'foo/macro.non_visible_macro.html' + //@ has - '//a[@class="macro"]' 'visible_macro' + //@ !has - '//a[@class="macro"]' 'non_visible_macro' + //@ has 'foo/macro.visible_macro.html' + //@ !has 'foo/macro.non_visible_macro.html' #[macro_export] macro_rules! visible_macro { () => {} @@ -32,30 +32,30 @@ fn foo() { } } -// @has 'foo/index.html' -// @has - '//a[@href="struct.Bar.html"]' 'Bar' +//@ has 'foo/index.html' +//@ has - '//a[@href="struct.Bar.html"]' 'Bar' struct Bar; const BAR: i32 = { - // @!has - '//a[@href="fn.yo.html"]' 'yo' - // @!has 'foo/fn.yo.html' + //@ !has - '//a[@href="fn.yo.html"]' 'yo' + //@ !has 'foo/fn.yo.html' fn yo() {} - // @!has 'foo/index.html' '//a[@href="trait.Foo.html"]' 'Foo' - // @!has 'foo/trait.Foo.html' + //@ !has 'foo/index.html' '//a[@href="trait.Foo.html"]' 'Foo' + //@ !has 'foo/trait.Foo.html' trait Foo { fn babar() {} } impl Foo for Bar {} - // @has 'foo/struct.Bar.html' - // @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'pub(crate) fn foo()' - // @count - '//*[@id="main-content"]/*[@class="section-header"]' 3 + //@ has 'foo/struct.Bar.html' + //@ has - '//*[@id="method.foo"]/*[@class="code-header"]' 'pub(crate) fn foo()' + //@ count - '//*[@id="main-content"]/*[@class="section-header"]' 3 // We now check that the `Foo` trait is not documented nor visible on `Bar` page. - // @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Implementations' - // @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Auto Trait Implementations' - // @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Blanket Implementations' - // @!has - '//*[@href="trait.Foo.html#method.babar"]/*[@class="code-header"]' 'fn babar()' + //@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Implementations' + //@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Auto Trait Implementations' + //@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Blanket Implementations' + //@ !has - '//*[@href="trait.Foo.html#method.babar"]/*[@class="code-header"]' 'fn babar()' impl Bar { fn foo() {} } diff --git a/tests/rustdoc/issue-110629-private-type-cycle.rs b/tests/rustdoc/issue-110629-private-type-cycle.rs index e8847d7f125..22ea721fd44 100644 --- a/tests/rustdoc/issue-110629-private-type-cycle.rs +++ b/tests/rustdoc/issue-110629-private-type-cycle.rs @@ -4,8 +4,8 @@ type Bar<'a, 'b> = impl PartialEq> + std::fmt::Debug; -// @has issue_110629_private_type_cycle/type.Bar.html -// @has - '//pre[@class="rust item-decl"]' \ +//@ has issue_110629_private_type_cycle/type.Bar.html +//@ has - '//pre[@class="rust item-decl"]' \ // "pub(crate) type Bar<'a, 'b> = impl PartialEq> + Debug;" fn bar<'a, 'b>(i: &'a i32) -> Bar<'a, 'b> { diff --git a/tests/rustdoc/issue-111064-reexport-trait-from-hidden-2.rs b/tests/rustdoc/issue-111064-reexport-trait-from-hidden-2.rs index 65c26d6a837..4b80f508e7f 100644 --- a/tests/rustdoc/issue-111064-reexport-trait-from-hidden-2.rs +++ b/tests/rustdoc/issue-111064-reexport-trait-from-hidden-2.rs @@ -2,17 +2,17 @@ #![no_core] #![crate_name = "foo"] -// @files "foo" "['sidebar-items.js', 'all.html', 'hidden', 'index.html', 'struct.Bar.html', \ +//@ 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']" +//@ 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' +//@ !has 'foo/hidden/index.html' +//@ !has 'foo/hidden/inner/index.html' // FIXME: Should be `@!has`: https://github.com/rust-lang/rust/issues/111249 -// @has 'foo/hidden/inner/trait.Foo.html' -// @matchesraw - '' +//@ has 'foo/hidden/inner/trait.Foo.html' +//@ matchesraw - '' #[doc(hidden)] pub mod hidden { pub mod inner { @@ -23,13 +23,13 @@ pub mod hidden { } } -// @has 'foo/visible/index.html' -// @has 'foo/visible/trait.Foo.html' +//@ has 'foo/visible/index.html' +//@ has 'foo/visible/trait.Foo.html' #[doc(inline)] pub use hidden::inner as visible; -// @has 'foo/struct.Bar.html' -// @count - '//*[@id="impl-Foo-for-Bar"]' 1 +//@ has 'foo/struct.Bar.html' +//@ count - '//*[@id="impl-Foo-for-Bar"]' 1 pub struct Bar; impl visible::Foo for Bar { diff --git a/tests/rustdoc/issue-111064-reexport-trait-from-hidden.rs b/tests/rustdoc/issue-111064-reexport-trait-from-hidden.rs index a9ce4a34507..84ec818ef33 100644 --- a/tests/rustdoc/issue-111064-reexport-trait-from-hidden.rs +++ b/tests/rustdoc/issue-111064-reexport-trait-from-hidden.rs @@ -4,11 +4,11 @@ #![crate_name = "foo"] -// @has 'foo/index.html' -// @has - '//*[@id="main-content"]//*[@class="item-name"]/a[@href="trait.Foo.html"]' 'Foo' +//@ has 'foo/index.html' +//@ has - '//*[@id="main-content"]//*[@class="item-name"]/a[@href="trait.Foo.html"]' 'Foo' -// @has 'foo/trait.Foo.html' -// @has - '//*[@id="main-content"]//*[@class="code-header"]' 'fn test()' +//@ has 'foo/trait.Foo.html' +//@ has - '//*[@id="main-content"]//*[@class="code-header"]' 'fn test()' #[doc(hidden)] mod hidden { diff --git a/tests/rustdoc/issue-111249-file-creation.rs b/tests/rustdoc/issue-111249-file-creation.rs index afd65ddaf94..89a25aef97d 100644 --- a/tests/rustdoc/issue-111249-file-creation.rs +++ b/tests/rustdoc/issue-111249-file-creation.rs @@ -2,20 +2,20 @@ #![feature(no_core)] #![no_core] -// @files "foo" "['all.html', 'visible', 'index.html', 'sidebar-items.js', 'hidden', \ +//@ 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']" +//@ 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' +//@ !has 'foo/hidden/index.html' +//@ !has 'foo/hidden/inner/index.html' // FIXME: Should be `@!has`: https://github.com/rust-lang/rust/issues/111249 -// @has 'foo/hidden/inner/trait.Foo.html' -// @matchesraw - '' -// @!has 'foo/hidden/inner/inner_hidden/index.html' -// @!has 'foo/hidden/inner/inner_hidden/trait.HiddenFoo.html' +//@ has 'foo/hidden/inner/trait.Foo.html' +//@ matchesraw - '' +//@ !has 'foo/hidden/inner/inner_hidden/index.html' +//@ !has 'foo/hidden/inner/inner_hidden/trait.HiddenFoo.html' #[doc(hidden)] pub mod hidden { pub mod inner { @@ -28,13 +28,13 @@ pub mod hidden { } } -// @has 'foo/visible/index.html' -// @has 'foo/visible/trait.Foo.html' +//@ has 'foo/visible/index.html' +//@ has 'foo/visible/trait.Foo.html' #[doc(inline)] pub use hidden::inner as visible; -// @has 'foo/struct.Bar.html' -// @count - '//*[@id="impl-Foo-for-Bar"]' 1 +//@ has 'foo/struct.Bar.html' +//@ count - '//*[@id="impl-Foo-for-Bar"]' 1 pub struct Bar; impl visible::Foo for Bar {} diff --git a/tests/rustdoc/issue-113982-doc_auto_cfg-reexport-foreign.rs b/tests/rustdoc/issue-113982-doc_auto_cfg-reexport-foreign.rs index 6d84ceb0165..c083d9495f4 100644 --- a/tests/rustdoc/issue-113982-doc_auto_cfg-reexport-foreign.rs +++ b/tests/rustdoc/issue-113982-doc_auto_cfg-reexport-foreign.rs @@ -6,14 +6,14 @@ extern crate colors; -// @has 'foo/index.html' '//*[@class="stab portability"]' 'Non-colors' -// @has 'foo/struct.Color.html' '//*[@class="stab portability"]' \ +//@ has 'foo/index.html' '//*[@class="stab portability"]' 'Non-colors' +//@ has 'foo/struct.Color.html' '//*[@class="stab portability"]' \ // 'Available on non-crate feature colors only.' #[cfg(not(feature = "colors"))] pub use colors::*; -// @has 'foo/index.html' '//*[@class="stab portability"]' 'Non-fruits' -// @has 'foo/struct.Red.html' '//*[@class="stab portability"]' \ +//@ has 'foo/index.html' '//*[@class="stab portability"]' 'Non-fruits' +//@ has 'foo/struct.Red.html' '//*[@class="stab portability"]' \ // 'Available on non-crate feature fruits only.' #[cfg(not(feature = "fruits"))] pub use colors::Color as Red; diff --git a/tests/rustdoc/issue-115295-macro-const-display.rs b/tests/rustdoc/issue-115295-macro-const-display.rs index 2916c7a84a1..0dadb76ae5c 100644 --- a/tests/rustdoc/issue-115295-macro-const-display.rs +++ b/tests/rustdoc/issue-115295-macro-const-display.rs @@ -1,9 +1,9 @@ #![crate_name = "foo"] -// @has foo/trait.Trait.html +//@ has foo/trait.Trait.html pub trait Trait {} -// @has foo/struct.WithConst.html +//@ has foo/struct.WithConst.html pub struct WithConst; macro_rules! spans_from_macro { @@ -22,19 +22,19 @@ macro_rules! spans_from_macro { }; } -// @has - '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Trait> for WithConst<41>" impl Trait> for WithConst<41> {} -// @has - '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl WithConst<42>" -// @has - '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Trait> for WithConst<42>" -// @has - '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Trait> for WithConst<{ 43 }>" -// @has - '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Trait> for WithConst<44>" -// @has foo/struct.Other.html -// @has - //pre "pub field: WithConst<42>" +//@ has foo/struct.Other.html +//@ has - //pre "pub field: WithConst<42>" spans_from_macro!(); diff --git a/tests/rustdoc/issue-118180-empty-tuple-struct.rs b/tests/rustdoc/issue-118180-empty-tuple-struct.rs index bc6ddbe5def..2cd1df27b2b 100644 --- a/tests/rustdoc/issue-118180-empty-tuple-struct.rs +++ b/tests/rustdoc/issue-118180-empty-tuple-struct.rs @@ -1,9 +1,9 @@ -// @has issue_118180_empty_tuple_struct/enum.Enum.html +//@ has issue_118180_empty_tuple_struct/enum.Enum.html pub enum Enum { - // @has - '//*[@id="variant.Empty"]//h3' 'Empty()' + //@ has - '//*[@id="variant.Empty"]//h3' 'Empty()' Empty(), } -// @has issue_118180_empty_tuple_struct/struct.Empty.html -// @has - '//pre/code' 'Empty()' +//@ has issue_118180_empty_tuple_struct/struct.Empty.html +//@ has - '//pre/code' 'Empty()' pub struct Empty(); diff --git a/tests/rustdoc/issue-99221-multiple-macro-rules-w-same-name.rs b/tests/rustdoc/issue-99221-multiple-macro-rules-w-same-name.rs index f4f62717cea..e7fb4fb3f0e 100644 --- a/tests/rustdoc/issue-99221-multiple-macro-rules-w-same-name.rs +++ b/tests/rustdoc/issue-99221-multiple-macro-rules-w-same-name.rs @@ -9,7 +9,7 @@ extern crate issue_99221_aux; pub use issue_99221_aux::*; -// @count foo/index.html '//a[@class="macro"]' 1 +//@ count foo/index.html '//a[@class="macro"]' 1 #[macro_export] macro_rules! print { diff --git a/tests/rustdoc/issue-99221-multiple-structs-w-same-name.rs b/tests/rustdoc/issue-99221-multiple-structs-w-same-name.rs index 4852ee71da7..8758342fe07 100644 --- a/tests/rustdoc/issue-99221-multiple-structs-w-same-name.rs +++ b/tests/rustdoc/issue-99221-multiple-structs-w-same-name.rs @@ -9,6 +9,6 @@ extern crate issue_99221_aux; pub use issue_99221_aux::*; -// @count foo/index.html '//a[@class="struct"][@title="struct foo::Print"]' 1 +//@ count foo/index.html '//a[@class="struct"][@title="struct foo::Print"]' 1 pub struct Print; diff --git a/tests/rustdoc/issue-99734-multiple-foreigns-w-same-name.rs b/tests/rustdoc/issue-99734-multiple-foreigns-w-same-name.rs index 9c94fdd9160..d7c4f1db320 100644 --- a/tests/rustdoc/issue-99734-multiple-foreigns-w-same-name.rs +++ b/tests/rustdoc/issue-99734-multiple-foreigns-w-same-name.rs @@ -9,7 +9,7 @@ extern crate issue_99734_aux; pub use issue_99734_aux::*; -// @count foo/index.html '//a[@class="fn"][@title="fn foo::main"]' 1 +//@ count foo/index.html '//a[@class="fn"][@title="fn foo::main"]' 1 extern "C" { pub fn main() -> std::ffi::c_int; diff --git a/tests/rustdoc/issue-99734-multiple-mods-w-same-name.rs b/tests/rustdoc/issue-99734-multiple-mods-w-same-name.rs index 41aeb30a461..627cfc0b80b 100644 --- a/tests/rustdoc/issue-99734-multiple-mods-w-same-name.rs +++ b/tests/rustdoc/issue-99734-multiple-mods-w-same-name.rs @@ -9,6 +9,6 @@ extern crate issue_99734_aux; pub use issue_99734_aux::*; -// @count foo/index.html '//a[@class="mod"][@title="mod foo::task"]' 1 +//@ count foo/index.html '//a[@class="mod"][@title="mod foo::task"]' 1 pub mod task {} diff --git a/tests/rustdoc/item-desc-list-at-start.rs b/tests/rustdoc/item-desc-list-at-start.rs index d88c61d333e..fbcc36066f1 100644 --- a/tests/rustdoc/item-desc-list-at-start.rs +++ b/tests/rustdoc/item-desc-list-at-start.rs @@ -1,7 +1,7 @@ -// @has item_desc_list_at_start/index.html -// @count - '//ul[@class="item-table"]/li/div/li' 0 -// @count - '//ul[@class="item-table"]/li' 1 -// @snapshot item-table - '//ul[@class="item-table"]' +//@ has item_desc_list_at_start/index.html +//@ count - '//ul[@class="item-table"]/li/div/li' 0 +//@ count - '//ul[@class="item-table"]/li' 1 +//@ snapshot item-table - '//ul[@class="item-table"]' // based on https://docs.rs/gl_constants/0.1.1/src/gl_constants/lib.rs.html#16 diff --git a/tests/rustdoc/jump-to-def-doc-links-calls.rs b/tests/rustdoc/jump-to-def-doc-links-calls.rs index 4101058edbf..61856978773 100644 --- a/tests/rustdoc/jump-to-def-doc-links-calls.rs +++ b/tests/rustdoc/jump-to-def-doc-links-calls.rs @@ -2,21 +2,21 @@ #![crate_name = "foo"] -// @has 'src/foo/jump-to-def-doc-links-calls.rs.html' +//@ has 'src/foo/jump-to-def-doc-links-calls.rs.html' -// @has - '//a[@href="../../foo/struct.Bar.html"]' 'Bar' +//@ has - '//a[@href="../../foo/struct.Bar.html"]' 'Bar' pub struct Bar; impl std::default::Default for Bar { - // @has - '//a[@href="#20-22"]' 'Self::new' + //@ has - '//a[@href="#20-22"]' 'Self::new' fn default() -> Self { Self::new() } } -// @has - '//a[@href="#8"]' 'Bar' +//@ has - '//a[@href="#8"]' 'Bar' impl Bar { - // @has - '//a[@href="#24-26"]' 'Self::bar' + //@ has - '//a[@href="#24-26"]' 'Self::bar' pub fn new()-> Self { Self::bar() } diff --git a/tests/rustdoc/jump-to-def-doc-links.rs b/tests/rustdoc/jump-to-def-doc-links.rs index 1722aa40437..2abb52e0a00 100644 --- a/tests/rustdoc/jump-to-def-doc-links.rs +++ b/tests/rustdoc/jump-to-def-doc-links.rs @@ -2,19 +2,19 @@ #![crate_name = "foo"] -// @has 'src/foo/jump-to-def-doc-links.rs.html' +//@ has 'src/foo/jump-to-def-doc-links.rs.html' -// @has - '//a[@href="../../foo/struct.Bar.html"]' 'Bar' -// @has - '//a[@href="../../foo/struct.Foo.html"]' 'Foo' +//@ has - '//a[@href="../../foo/struct.Bar.html"]' 'Bar' +//@ has - '//a[@href="../../foo/struct.Foo.html"]' 'Foo' pub struct Bar; pub struct Foo; -// @has - '//a[@href="../../foo/enum.Enum.html"]' 'Enum' +//@ has - '//a[@href="../../foo/enum.Enum.html"]' 'Enum' pub enum Enum { Variant1(String), Variant2(u8), } -// @has - '//a[@href="../../foo/struct.Struct.html"]' 'Struct' +//@ has - '//a[@href="../../foo/struct.Struct.html"]' 'Struct' pub struct Struct { pub a: u8, b: Foo, @@ -27,7 +27,7 @@ impl Struct { fn bar(&self) {} } -// @has - '//a[@href="../../foo/trait.Trait.html"]' 'Trait' +//@ has - '//a[@href="../../foo/trait.Trait.html"]' 'Trait' pub trait Trait { fn foo(); } @@ -36,16 +36,16 @@ impl Trait for Struct { fn foo() {} } -// @has - '//a[@href="../../foo/union.Union.html"]' 'Union' +//@ has - '//a[@href="../../foo/union.Union.html"]' 'Union' pub union Union { pub a: u16, pub f: u32, } -// @has - '//a[@href="../../foo/fn.bar.html"]' 'bar' +//@ has - '//a[@href="../../foo/fn.bar.html"]' 'bar' pub fn bar(b: Bar) { let x = Foo; } -// @has - '//a[@href="../../foo/bar/index.html"]' 'bar' +//@ has - '//a[@href="../../foo/bar/index.html"]' 'bar' pub mod bar {} diff --git a/tests/rustdoc/jump-to-def-macro.rs b/tests/rustdoc/jump-to-def-macro.rs index e8e97a442dd..680477937c6 100644 --- a/tests/rustdoc/jump-to-def-macro.rs +++ b/tests/rustdoc/jump-to-def-macro.rs @@ -4,12 +4,12 @@ #![crate_name = "foo"] -// @has 'src/foo/jump-to-def-macro.rs.html' +//@ has 'src/foo/jump-to-def-macro.rs.html' #[macro_use] extern crate jump_to_def_macro; -// @has - '//a[@href="../../jump_to_def_macro/macro.symbols.html"]' 'symbols!' +//@ has - '//a[@href="../../jump_to_def_macro/macro.symbols.html"]' 'symbols!' symbols! { A = 12 } diff --git a/tests/rustdoc/jump-to-non-local-method.rs b/tests/rustdoc/jump-to-non-local-method.rs index bc44d9a9708..e2f530425f0 100644 --- a/tests/rustdoc/jump-to-non-local-method.rs +++ b/tests/rustdoc/jump-to-non-local-method.rs @@ -2,46 +2,46 @@ #![crate_name = "foo"] -// @has 'src/foo/jump-to-non-local-method.rs.html' +//@ has 'src/foo/jump-to-non-local-method.rs.html' -// @has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html"]' 'std::sync::atomic::AtomicIsize' +//@ has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html"]' 'std::sync::atomic::AtomicIsize' use std::sync::atomic::AtomicIsize; -// @has - '//a[@href="{{channel}}/std/io/trait.Read.html"]' 'std::io::Read' +//@ has - '//a[@href="{{channel}}/std/io/trait.Read.html"]' 'std::io::Read' use std::io::Read; -// @has - '//a[@href="{{channel}}/std/io/index.html"]' 'std::io' +//@ has - '//a[@href="{{channel}}/std/io/index.html"]' 'std::io' use std::io; -// @has - '//a[@href="{{channel}}/std/process/fn.exit.html"]' 'std::process::exit' +//@ has - '//a[@href="{{channel}}/std/process/fn.exit.html"]' 'std::process::exit' use std::process::exit; use std::cmp::Ordering; use std::marker::PhantomData; pub fn bar2(readable: T) { - // @has - '//a[@href="{{channel}}/std/io/trait.Read.html#tymethod.read"]' 'read' + //@ has - '//a[@href="{{channel}}/std/io/trait.Read.html#tymethod.read"]' 'read' let _ = readable.read(&mut []); } pub fn bar() { - // @has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html#method.new"]' 'AtomicIsize::new' + //@ has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html#method.new"]' 'AtomicIsize::new' let _ = AtomicIsize::new(0); - // @has - '//a[@href="#48"]' 'local_private' + //@ has - '//a[@href="#48"]' 'local_private' local_private(); } pub fn extern_call() { - // @has - '//a[@href="{{channel}}/std/process/fn.exit.html"]' 'exit' + //@ has - '//a[@href="{{channel}}/std/process/fn.exit.html"]' 'exit' exit(0); } pub fn macro_call() -> Result<(), ()> { - // @has - '//a[@href="{{channel}}/core/macro.try.html"]' 'try!' + //@ has - '//a[@href="{{channel}}/core/macro.try.html"]' 'try!' try!(Err(())); Ok(()) } pub fn variant() { - // @has - '//a[@href="{{channel}}/core/cmp/enum.Ordering.html#variant.Less"]' 'Ordering::Less' + //@ has - '//a[@href="{{channel}}/core/cmp/enum.Ordering.html#variant.Less"]' 'Ordering::Less' let _ = Ordering::Less; - // @has - '//a[@href="{{channel}}/core/marker/struct.PhantomData.html"]' 'PhantomData' + //@ has - '//a[@href="{{channel}}/core/marker/struct.PhantomData.html"]' 'PhantomData' let _: PhantomData:: = PhantomData; } diff --git a/tests/rustdoc/keyword.rs b/tests/rustdoc/keyword.rs index 4d047af3255..0157c35288e 100644 --- a/tests/rustdoc/keyword.rs +++ b/tests/rustdoc/keyword.rs @@ -2,22 +2,22 @@ #![feature(rustdoc_internals)] -// @has foo/index.html '//h2[@id="keywords"]' 'Keywords' -// @has foo/index.html '//a[@href="keyword.match.html"]' 'match' -// @has foo/index.html '//div[@class="sidebar-elems"]//li/a' 'Keywords' -// @has foo/index.html '//div[@class="sidebar-elems"]//li/a/@href' '#keywords' -// @has foo/keyword.match.html '//a[@class="keyword"]' 'match' -// @has foo/keyword.match.html '//h1' 'Keyword match' -// @has foo/keyword.match.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' -// @has foo/index.html '//a/@href' '../foo/index.html' -// @!has foo/foo/index.html -// @!has-dir foo/foo -// @!has foo/index.html '//span' '🔒' +//@ has foo/index.html '//h2[@id="keywords"]' 'Keywords' +//@ has foo/index.html '//a[@href="keyword.match.html"]' 'match' +//@ has foo/index.html '//div[@class="sidebar-elems"]//li/a' 'Keywords' +//@ has foo/index.html '//div[@class="sidebar-elems"]//li/a/@href' '#keywords' +//@ has foo/keyword.match.html '//a[@class="keyword"]' 'match' +//@ has foo/keyword.match.html '//h1' 'Keyword match' +//@ has foo/keyword.match.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' +//@ has foo/index.html '//a/@href' '../foo/index.html' +//@ !has foo/foo/index.html +//@ !has-dir foo/foo +//@ !has foo/index.html '//span' '🔒' #[doc(keyword = "match")] /// this is a test! mod foo{} -// @has foo/keyword.foo.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello' +//@ has foo/keyword.foo.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello' #[doc(keyword = "foo")] /// hello mod bar {} diff --git a/tests/rustdoc/legacy-const-generic.rs b/tests/rustdoc/legacy-const-generic.rs index 3a488bdd208..41df535f3e0 100644 --- a/tests/rustdoc/legacy-const-generic.rs +++ b/tests/rustdoc/legacy-const-generic.rs @@ -1,15 +1,15 @@ #![crate_name = "foo"] #![feature(rustc_attrs)] -// @has 'foo/fn.foo.html' -// @has - '//pre[@class="rust item-decl"]' 'fn foo(x: usize, const Y: usize, z: usize) -> [usize; 3]' +//@ has 'foo/fn.foo.html' +//@ has - '//pre[@class="rust item-decl"]' 'fn foo(x: usize, const Y: usize, z: usize) -> [usize; 3]' #[rustc_legacy_const_generics(1)] pub fn foo(x: usize, z: usize) -> [usize; 3] { [x, Y, z] } -// @has 'foo/fn.bar.html' -// @has - '//pre[@class="rust item-decl"]' 'fn bar(x: usize, const Y: usize, const Z: usize) -> [usize; 3]' +//@ has 'foo/fn.bar.html' +//@ has - '//pre[@class="rust item-decl"]' 'fn bar(x: usize, const Y: usize, const Z: usize) -> [usize; 3]' #[rustc_legacy_const_generics(1, 2)] pub fn bar(x: usize) -> [usize; 3] { [x, Y, z] diff --git a/tests/rustdoc/lifetime-name.rs b/tests/rustdoc/lifetime-name.rs index 15e09f5165a..1e583f1811d 100644 --- a/tests/rustdoc/lifetime-name.rs +++ b/tests/rustdoc/lifetime-name.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -// @has 'foo/type.Resolutions.html' -// @has - '//pre[@class="rust item-decl"]' "pub type Resolutions<'tcx> = &'tcx u8;" +//@ has 'foo/type.Resolutions.html' +//@ has - '//pre[@class="rust item-decl"]' "pub type Resolutions<'tcx> = &'tcx u8;" pub type Resolutions<'tcx> = &'tcx u8; diff --git a/tests/rustdoc/line-breaks.rs b/tests/rustdoc/line-breaks.rs index 0f760d51973..b82894ab68f 100644 --- a/tests/rustdoc/line-breaks.rs +++ b/tests/rustdoc/line-breaks.rs @@ -3,7 +3,7 @@ use std::fmt::Display; use std::ops::Add; -// @matches foo/fn.function_with_a_really_long_name.html '//*[@class="rust item-decl"]//code' "\ +//@ matches foo/fn.function_with_a_really_long_name.html '//*[@class="rust item-decl"]//code' "\ // function_with_a_really_long_name\(\n\ // \ parameter_one: i32,\n\ // \ parameter_two: i32,\n\ @@ -12,13 +12,13 @@ pub fn function_with_a_really_long_name(parameter_one: i32, parameter_two: i32) Some(parameter_one + parameter_two) } -// @matches foo/fn.short_name.html '//*[@class="rust item-decl"]//code' \ +//@ matches foo/fn.short_name.html '//*[@class="rust item-decl"]//code' \ // "short_name\(param: i32\) -> i32$" pub fn short_name(param: i32) -> i32 { param + 1 } -// @matches foo/fn.where_clause.html '//*[@class="rust item-decl"]//code' "\ +//@ matches foo/fn.where_clause.html '//*[@class="rust item-decl"]//code' "\ // where_clause\(param_one: T, param_two: U\)where\n\ // \ T: Add \+ Display \+ Copy,\n\ // \ U: Add \+ Display \+ Copy,\n\ diff --git a/tests/rustdoc/link-assoc-const.rs b/tests/rustdoc/link-assoc-const.rs index 75a2531a308..56b82fb2d39 100644 --- a/tests/rustdoc/link-assoc-const.rs +++ b/tests/rustdoc/link-assoc-const.rs @@ -1,7 +1,7 @@ #![crate_name = "foo"] -// @has foo/index.html '//a[@href="foo/constant.FIRSTCONST.html"]' 'foo::FIRSTCONST' -// @has foo/index.html '//a[@href="struct.Bar.html#associatedconstant.CONST"]' 'Bar::CONST' +//@ has foo/index.html '//a[@href="foo/constant.FIRSTCONST.html"]' 'foo::FIRSTCONST' +//@ has foo/index.html '//a[@href="struct.Bar.html#associatedconstant.CONST"]' 'Bar::CONST' //! We have here [`foo::FIRSTCONST`] and [`Bar::CONST`]. diff --git a/tests/rustdoc/link-extern-crate-33178.rs b/tests/rustdoc/link-extern-crate-33178.rs index d62bab5111f..94822798af3 100644 --- a/tests/rustdoc/link-extern-crate-33178.rs +++ b/tests/rustdoc/link-extern-crate-33178.rs @@ -6,12 +6,12 @@ // https://github.com/rust-lang/rust/issues/33178 #![crate_name="issue_33178"] -// @has issue_33178/index.html -// @has - '//a[@title="mod empty"][@href="../empty/index.html"]' empty +//@ has issue_33178/index.html +//@ has - '//a[@title="mod empty"][@href="../empty/index.html"]' empty pub extern crate empty; -// @has - '//a[@title="mod variant_struct"][@href="../variant_struct/index.html"]' variant_struct +//@ has - '//a[@title="mod variant_struct"][@href="../variant_struct/index.html"]' variant_struct pub extern crate variant_struct as foo; -// @has - '//a[@title="mod issue_33178"][@href="index.html"]' self +//@ has - '//a[@title="mod issue_33178"][@href="index.html"]' self pub extern crate self as bar; diff --git a/tests/rustdoc/link-extern-crate-item-30109.rs b/tests/rustdoc/link-extern-crate-item-30109.rs index a57d16da820..544cfa14971 100644 --- a/tests/rustdoc/link-extern-crate-item-30109.rs +++ b/tests/rustdoc/link-extern-crate-item-30109.rs @@ -11,7 +11,7 @@ pub mod quux { pub trait Foo {} - // @has issue_30109/quux/trait.Foo.html \ + //@ has issue_30109/quux/trait.Foo.html \ // '//a/@href' '../issue_30109_1/struct.Bar.html' impl Foo for Bar {} } diff --git a/tests/rustdoc/link-extern-crate-title-33178.rs b/tests/rustdoc/link-extern-crate-title-33178.rs index e85ddb2c891..39c4fec1cd9 100644 --- a/tests/rustdoc/link-extern-crate-title-33178.rs +++ b/tests/rustdoc/link-extern-crate-title-33178.rs @@ -5,9 +5,9 @@ // https://github.com/rust-lang/rust/issues/33178 #![crate_name="issue_33178_1"] -// @has issue_33178_1/index.html -// @!has - //a/@title empty +//@ has issue_33178_1/index.html +//@ !has - //a/@title empty pub extern crate empty; -// @!has - //a/@title variant_struct +//@ !has - //a/@title variant_struct pub extern crate variant_struct as foo; diff --git a/tests/rustdoc/link-title-escape.rs b/tests/rustdoc/link-title-escape.rs index 7a322ea6d34..35e55c0f904 100644 --- a/tests/rustdoc/link-title-escape.rs +++ b/tests/rustdoc/link-title-escape.rs @@ -6,4 +6,4 @@ //! //! [foo]: url 'title & & "things"' -// @hasraw 'foo/index.html' 'title & <stuff> & "things"' +//@ hasraw 'foo/index.html' 'title & <stuff> & "things"' diff --git a/tests/rustdoc/links-in-headings.rs b/tests/rustdoc/links-in-headings.rs index c5bee1a7975..5a23af0e797 100644 --- a/tests/rustdoc/links-in-headings.rs +++ b/tests/rustdoc/links-in-headings.rs @@ -8,7 +8,7 @@ //! //! ! -// @has 'foo/index.html' -// @has - '//h2/a[@href="https://a.com"]' 'a link' -// @has - '//h3/a[@href="https://b.com"]' 'multiple' -// @has - '//h3/a[@href="https://c.com"]' 'links' +//@ has 'foo/index.html' +//@ has - '//h2/a[@href="https://a.com"]' 'a link' +//@ has - '//h3/a[@href="https://b.com"]' 'multiple' +//@ has - '//h3/a[@href="https://c.com"]' 'links' diff --git a/tests/rustdoc/local-reexport-doc.rs b/tests/rustdoc/local-reexport-doc.rs index 5dc857773a3..6db8f999d29 100644 --- a/tests/rustdoc/local-reexport-doc.rs +++ b/tests/rustdoc/local-reexport-doc.rs @@ -3,8 +3,8 @@ #![crate_name = "foo"] -// @has 'foo/fn.g.html' -// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' \ +//@ has 'foo/fn.g.html' +//@ has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' \ // 'outer module inner module' mod inner_mod { diff --git a/tests/rustdoc/logo-class-default.rs b/tests/rustdoc/logo-class-default.rs index 6b46b46051f..cabf95569ee 100644 --- a/tests/rustdoc/logo-class-default.rs +++ b/tests/rustdoc/logo-class-default.rs @@ -1,4 +1,4 @@ // Note: this test is paired with logo-class.rs and logo-class-rust.rs. -// @!has logo_class_default/struct.SomeStruct.html '//*[@class="logo-container"]/img' '' -// @!has src/logo_class_default/logo-class-default.rs.html '//*[@class="sub-logo-container"]/img' '' +//@ !has logo_class_default/struct.SomeStruct.html '//*[@class="logo-container"]/img' '' +//@ !has src/logo_class_default/logo-class-default.rs.html '//*[@class="sub-logo-container"]/img' '' pub struct SomeStruct; diff --git a/tests/rustdoc/logo-class-rust.rs b/tests/rustdoc/logo-class-rust.rs index c8f7f063dde..d37438f7619 100644 --- a/tests/rustdoc/logo-class-rust.rs +++ b/tests/rustdoc/logo-class-rust.rs @@ -2,5 +2,5 @@ #![allow(internal_features)] #![doc(rust_logo)] // Note: this test is paired with logo-class.rs and logo-class-default.rs. -// @has logo_class_rust/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' '' +//@ has logo_class_rust/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' '' pub struct SomeStruct; diff --git a/tests/rustdoc/logo-class.rs b/tests/rustdoc/logo-class.rs index 816f40df014..73d5244fc41 100644 --- a/tests/rustdoc/logo-class.rs +++ b/tests/rustdoc/logo-class.rs @@ -2,6 +2,6 @@ "https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png")] // Note: this test is paired with logo-class-default.rs and logo-class-rust.rs. -// @has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' '' -// @!has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' '' +//@ has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' '' +//@ !has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' '' pub struct SomeStruct; diff --git a/tests/rustdoc/macro-doc-comment-23812.rs b/tests/rustdoc/macro-doc-comment-23812.rs index 57c18510b1e..03fda4a25b9 100644 --- a/tests/rustdoc/macro-doc-comment-23812.rs +++ b/tests/rustdoc/macro-doc-comment-23812.rs @@ -18,11 +18,11 @@ doc! { } } -// @has issue_23812/Foo/index.html -// @hasraw - 'Outer comment' -// @!hasraw - '/// Outer comment' -// @hasraw - 'Inner comment' -// @!hasraw - '//! Inner comment' +//@ has issue_23812/Foo/index.html +//@ hasraw - 'Outer comment' +//@ !hasraw - '/// Outer comment' +//@ hasraw - 'Inner comment' +//@ !hasraw - '//! Inner comment' doc! { @@ -32,8 +32,8 @@ doc! { } } -// @has issue_23812/Bar/index.html -// @hasraw - 'Outer block comment' -// @!hasraw - '/** Outer block comment */' -// @hasraw - 'Inner block comment' -// @!hasraw - '/*! Inner block comment */' +//@ has issue_23812/Bar/index.html +//@ hasraw - 'Outer block comment' +//@ !hasraw - '/** Outer block comment */' +//@ hasraw - 'Inner block comment' +//@ !hasraw - '/*! Inner block comment */' diff --git a/tests/rustdoc/macro-document-private-duplicate.rs b/tests/rustdoc/macro-document-private-duplicate.rs index 703317be8c9..35cdc60dfdc 100644 --- a/tests/rustdoc/macro-document-private-duplicate.rs +++ b/tests/rustdoc/macro-document-private-duplicate.rs @@ -10,15 +10,15 @@ // //@ compile-flags: --document-private-items -// @hasraw macro_document_private_duplicate/index.html 'Doc 1.' -// @hasraw macro_document_private_duplicate/macro.a_macro.html 'Doc 1.' +//@ hasraw macro_document_private_duplicate/index.html 'Doc 1.' +//@ hasraw macro_document_private_duplicate/macro.a_macro.html 'Doc 1.' /// Doc 1. macro_rules! a_macro { () => () } -// @hasraw macro_document_private_duplicate/index.html 'Doc 2.' -// @!hasraw macro_document_private_duplicate/macro.a_macro.html 'Doc 2.' +//@ hasraw macro_document_private_duplicate/index.html 'Doc 2.' +//@ !hasraw macro_document_private_duplicate/macro.a_macro.html 'Doc 2.' /// Doc 2. macro_rules! a_macro { () => () diff --git a/tests/rustdoc/macro-document-private.rs b/tests/rustdoc/macro-document-private.rs index 2252aa87eba..224e31f8312 100644 --- a/tests/rustdoc/macro-document-private.rs +++ b/tests/rustdoc/macro-document-private.rs @@ -8,12 +8,12 @@ #![feature(decl_macro)] -// @has macro_document_private/macro.some_macro.html +//@ has macro_document_private/macro.some_macro.html macro some_macro { (a: tt) => {} } -// @has macro_document_private/macro.another_macro.html +//@ has macro_document_private/macro.another_macro.html macro_rules! another_macro { (a: tt) => {} } diff --git a/tests/rustdoc/macro-generated-macro.rs b/tests/rustdoc/macro-generated-macro.rs index 1a423cac1b5..e77d0cf89e7 100644 --- a/tests/rustdoc/macro-generated-macro.rs +++ b/tests/rustdoc/macro-generated-macro.rs @@ -7,23 +7,23 @@ macro_rules! make_macro { } } -// @has macro_generated_macro/macro.interpolations.html //pre 'macro_rules! interpolations {' -// @has - //pre '(<= type $($i:ident)::* + $e:expr =>) => { ... };' +//@ has macro_generated_macro/macro.interpolations.html //pre 'macro_rules! interpolations {' +//@ has - //pre '(<= type $($i:ident)::* + $e:expr =>) => { ... };' make_macro!(interpolations type $($i:ident)::* + $e:expr); interpolations!(<= type foo::bar + x.sort() =>); -// @has macro_generated_macro/macro.attributes.html //pre 'macro_rules! attributes {' -// @has - //pre '(<= #![no_std] #[cfg(feature = "alloc")] =>) => { ... };' +//@ has macro_generated_macro/macro.attributes.html //pre 'macro_rules! attributes {' +//@ has - //pre '(<= #![no_std] #[cfg(feature = "alloc")] =>) => { ... };' make_macro!(attributes #![no_std] #[cfg(feature = "alloc")]); -// @has macro_generated_macro/macro.groups.html //pre 'macro_rules! groups {' -// @has - //pre '(<= fn {} () { foo[0] } =>) => { ... };' +//@ has macro_generated_macro/macro.groups.html //pre 'macro_rules! groups {' +//@ has - //pre '(<= fn {} () { foo[0] } =>) => { ... };' make_macro!(groups fn {}() {foo[0]}); -// @snapshot macro_linebreak_pre macro_generated_macro/macro.linebreak.html //pre/text() +//@ snapshot macro_linebreak_pre macro_generated_macro/macro.linebreak.html //pre/text() make_macro!(linebreak 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28); -// @snapshot macro_morestuff_pre macro_generated_macro/macro.morestuff.html //pre/text() +//@ snapshot macro_morestuff_pre macro_generated_macro/macro.morestuff.html //pre/text() make_macro!(morestuff "space between most kinds of tokens": 1 $x + @ :: >>= 'static "no space inside paren or bracket": (2 a) [2 a] $(2 $a:tt)* diff --git a/tests/rustdoc/macro-higher-kinded-function.rs b/tests/rustdoc/macro-higher-kinded-function.rs index a45ef37a7fc..f14125d1309 100644 --- a/tests/rustdoc/macro-higher-kinded-function.rs +++ b/tests/rustdoc/macro-higher-kinded-function.rs @@ -10,11 +10,11 @@ macro_rules! gen { } } -// @has 'foo/struct.Providers.html' -// @has - '//*[@class="rust item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8," -// @has - '//*[@class="rust item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16," -// @has - '//*[@id="structfield.a"]/code' "a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8" -// @has - '//*[@id="structfield.b"]/code' "b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16" +//@ has 'foo/struct.Providers.html' +//@ has - '//*[@class="rust item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8," +//@ has - '//*[@class="rust item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16," +//@ has - '//*[@id="structfield.a"]/code' "a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8" +//@ has - '//*[@id="structfield.b"]/code' "b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16" gen! { (a, 'tcx, [u8], [i8]) (b, 'tcx, [u16], [i16]) diff --git a/tests/rustdoc/macro-indirect-use.rs b/tests/rustdoc/macro-indirect-use.rs index b2d9336cffc..e410e96ae6a 100644 --- a/tests/rustdoc/macro-indirect-use.rs +++ b/tests/rustdoc/macro-indirect-use.rs @@ -11,6 +11,6 @@ mod outer { } } -// @has macro_indirect_use/inner/index.html -// @has macro_indirect_use/inner/macro.some_macro.html +//@ has macro_indirect_use/inner/index.html +//@ has macro_indirect_use/inner/macro.some_macro.html pub use outer::inner; diff --git a/tests/rustdoc/macro-private-not-documented.rs b/tests/rustdoc/macro-private-not-documented.rs index f135a3a9ca6..bd97be5d366 100644 --- a/tests/rustdoc/macro-private-not-documented.rs +++ b/tests/rustdoc/macro-private-not-documented.rs @@ -6,14 +6,14 @@ // This is a regression text for issue #88453. #![feature(decl_macro)] -// @!hasraw macro_private_not_documented/index.html 'a_macro' -// @!has macro_private_not_documented/macro.a_macro.html +//@ !hasraw macro_private_not_documented/index.html 'a_macro' +//@ !has macro_private_not_documented/macro.a_macro.html macro_rules! a_macro { () => () } -// @!hasraw macro_private_not_documented/index.html 'another_macro' -// @!has macro_private_not_documented/macro.another_macro.html +//@ !hasraw macro_private_not_documented/index.html 'another_macro' +//@ !has macro_private_not_documented/macro.another_macro.html macro another_macro { () => () } diff --git a/tests/rustdoc/macro_pub_in_module.rs b/tests/rustdoc/macro_pub_in_module.rs index 06b7047893b..2dce73c2cf2 100644 --- a/tests/rustdoc/macro_pub_in_module.rs +++ b/tests/rustdoc/macro_pub_in_module.rs @@ -7,79 +7,79 @@ #![crate_name = "krate"] #![no_core] -// @has external_crate/some_module/macro.external_macro.html -// @!has external_crate/macro.external_macro.html +//@ has external_crate/some_module/macro.external_macro.html +//@ !has external_crate/macro.external_macro.html extern crate external_crate; pub mod inner { - // @has krate/inner/macro.raw_const.html - // @!has krate/macro.raw_const.html + //@ has krate/inner/macro.raw_const.html + //@ !has krate/macro.raw_const.html pub macro raw_const() {} - // @has krate/inner/attr.test.html - // @!has krate/macro.test.html - // @!has krate/inner/macro.test.html - // @!has krate/attr.test.html + //@ has krate/inner/attr.test.html + //@ !has krate/macro.test.html + //@ !has krate/inner/macro.test.html + //@ !has krate/attr.test.html #[rustc_builtin_macro] pub macro test($item:item) {} - // @has krate/inner/derive.Clone.html - // @!has krate/inner/macro.Clone.html - // @!has krate/macro.Clone.html - // @!has krate/derive.Clone.html + //@ has krate/inner/derive.Clone.html + //@ !has krate/inner/macro.Clone.html + //@ !has krate/macro.Clone.html + //@ !has krate/derive.Clone.html #[rustc_builtin_macro] pub macro Clone($item:item) {} // Make sure the logic is not affected by re-exports. mod unrenamed { - // @!has krate/macro.unrenamed.html + //@ !has krate/macro.unrenamed.html #[rustc_macro_transparency = "semitransparent"] pub macro unrenamed() {} } - // @has krate/inner/macro.unrenamed.html + //@ has krate/inner/macro.unrenamed.html pub use unrenamed::unrenamed; mod private { - // @!has krate/macro.m.html + //@ !has krate/macro.m.html pub macro m() {} } - // @has krate/inner/macro.renamed.html - // @!has krate/macro.renamed.html + //@ has krate/inner/macro.renamed.html + //@ !has krate/macro.renamed.html pub use private::m as renamed; mod private2 { - // @!has krate/macro.m2.html + //@ !has krate/macro.m2.html pub macro m2() {} } use private2 as renamed_mod; - // @has krate/inner/macro.m2.html + //@ has krate/inner/macro.m2.html pub use renamed_mod::m2; - // @has krate/inner/macro.external_macro.html - // @!has krate/macro.external_macro.html + //@ has krate/inner/macro.external_macro.html + //@ !has krate/macro.external_macro.html pub use ::external_crate::some_module::external_macro; } // Namespaces: Make sure the logic does not mix up a function name with a module name… fn both_fn_and_mod() { - // @!has krate/macro.in_both_fn_and_mod.html + //@ !has krate/macro.in_both_fn_and_mod.html pub macro in_both_fn_and_mod() {} } pub mod both_fn_and_mod { - // @!has krate/both_fn_and_mod/macro.in_both_fn_and_mod.html + //@ !has krate/both_fn_and_mod/macro.in_both_fn_and_mod.html } const __: () = { - // @!has krate/macro.in_both_const_and_mod.html + //@ !has krate/macro.in_both_const_and_mod.html pub macro in_both_const_and_mod() {} }; pub mod __ { - // @!has krate/__/macro.in_both_const_and_mod.html + //@ !has krate/__/macro.in_both_const_and_mod.html } enum Enum { Crazy = { - // @!has krate/macro.this_is_getting_weird.html; + //@ !has krate/macro.this_is_getting_weird.html; pub macro this_is_getting_weird() {} 42 }, diff --git a/tests/rustdoc/macro_rules-matchers.rs b/tests/rustdoc/macro_rules-matchers.rs index 96f4126c7c2..c3ee8febdf5 100644 --- a/tests/rustdoc/macro_rules-matchers.rs +++ b/tests/rustdoc/macro_rules-matchers.rs @@ -3,29 +3,29 @@ #![crate_name = "foo"] -// @has 'foo/macro.todo.html' -// @has - '//span[@class="macro"]' 'macro_rules!' -// @hasraw - ' todo {' +//@ has 'foo/macro.todo.html' +//@ has - '//span[@class="macro"]' 'macro_rules!' +//@ hasraw - ' todo {' -// @hasraw - '{ () => { ... }; ($(' -// @has - '//span[@class="macro-nonterminal"]' '$' -// @has - '//span[@class="macro-nonterminal"]' 'arg' -// @hasraw - ':tt)+' -// @hasraw - ') => { ... }; }' +//@ hasraw - '{ () => { ... }; ($(' +//@ has - '//span[@class="macro-nonterminal"]' '$' +//@ has - '//span[@class="macro-nonterminal"]' 'arg' +//@ hasraw - ':tt)+' +//@ hasraw - ') => { ... }; }' pub use std::todo; mod mod1 { - // @has 'foo/macro.macro1.html' - // @hasraw - 'macro_rules!' - // @hasraw - 'macro1' - // @hasraw - '{ () => { ... }; ($(' - // @has - '//span[@class="macro-nonterminal"]' '$' - // @has - '//span[@class="macro-nonterminal"]' 'arg' - // @hasraw - ':' - // @hasraw - 'expr' - // @hasraw - '),' - // @hasraw - '+' - // @hasraw - ') => { ... }; }' + //@ has 'foo/macro.macro1.html' + //@ hasraw - 'macro_rules!' + //@ hasraw - 'macro1' + //@ hasraw - '{ () => { ... }; ($(' + //@ has - '//span[@class="macro-nonterminal"]' '$' + //@ has - '//span[@class="macro-nonterminal"]' 'arg' + //@ hasraw - ':' + //@ hasraw - 'expr' + //@ hasraw - '),' + //@ hasraw - '+' + //@ hasraw - ') => { ... }; }' #[macro_export] macro_rules! macro1 { () => {}; diff --git a/tests/rustdoc/macros.rs b/tests/rustdoc/macros.rs index ae0cf7a1478..d08babc25f8 100644 --- a/tests/rustdoc/macros.rs +++ b/tests/rustdoc/macros.rs @@ -1,7 +1,7 @@ -// @has macros/macro.my_macro.html //pre 'macro_rules! my_macro {' -// @has - //pre '() => { ... };' -// @has - //pre '($a:tt) => { ... };' -// @has - //pre '($e:expr) => { ... };' +//@ has macros/macro.my_macro.html //pre 'macro_rules! my_macro {' +//@ has - //pre '() => { ... };' +//@ has - //pre '($a:tt) => { ... };' +//@ has - //pre '($e:expr) => { ... };' #[macro_export] macro_rules! my_macro { () => []; @@ -10,10 +10,10 @@ macro_rules! my_macro { } // Check that exported macro defined in a module are shown at crate root. -// @has macros/macro.my_sub_macro.html //pre 'macro_rules! my_sub_macro {' -// @has - //pre '() => { ... };' -// @has - //pre '($a:tt) => { ... };' -// @has - //pre '($e:expr) => { ... };' +//@ has macros/macro.my_sub_macro.html //pre 'macro_rules! my_sub_macro {' +//@ has - //pre '() => { ... };' +//@ has - //pre '($a:tt) => { ... };' +//@ has - //pre '($e:expr) => { ... };' mod sub { #[macro_export] macro_rules! my_sub_macro { diff --git a/tests/rustdoc/manual_impl.rs b/tests/rustdoc/manual_impl.rs index b2ee077bc6b..281262bb40a 100644 --- a/tests/rustdoc/manual_impl.rs +++ b/tests/rustdoc/manual_impl.rs @@ -1,7 +1,7 @@ -// @has manual_impl/trait.T.html -// @has - '//*[@class="docblock"]' 'Docs associated with the trait definition.' -// @has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' -// @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.' +//@ has manual_impl/trait.T.html +//@ has - '//*[@class="docblock"]' 'Docs associated with the trait definition.' +//@ has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' +//@ has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.' /// Docs associated with the trait definition. pub trait T { /// Docs associated with the trait a_method definition. @@ -20,14 +20,14 @@ pub trait T { } } -// @has manual_impl/struct.S1.html '//*[@class="trait"]' 'T' -// @has - '//*[@class="docblock"]' 'Docs associated with the S1 trait implementation.' -// @has - '//*[@class="docblock"]' 'Docs associated with the S1 trait a_method implementation.' -// @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' -// @has - '//div[@class="impl-items"]//div[@class="docblock"]' 'Docs associated with the trait b_method definition.' -// @has - '//div[@class="impl-items"]//div[@class="docblock"]' 'Docs associated with the trait c_method definition.' -// @!has - '//*[@class="docblock"]' 'There is another line' -// @has - '//div[@class="impl-items"]//div[@class="docblock"]' 'Read more' +//@ has manual_impl/struct.S1.html '//*[@class="trait"]' 'T' +//@ has - '//*[@class="docblock"]' 'Docs associated with the S1 trait implementation.' +//@ has - '//*[@class="docblock"]' 'Docs associated with the S1 trait a_method implementation.' +//@ !has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' +//@ has - '//div[@class="impl-items"]//div[@class="docblock"]' 'Docs associated with the trait b_method definition.' +//@ has - '//div[@class="impl-items"]//div[@class="docblock"]' 'Docs associated with the trait c_method definition.' +//@ !has - '//*[@class="docblock"]' 'There is another line' +//@ has - '//div[@class="impl-items"]//div[@class="docblock"]' 'Read more' pub struct S1(usize); /// Docs associated with the S1 trait implementation. @@ -38,11 +38,11 @@ impl T for S1 { } } -// @has manual_impl/struct.S2.html '//*[@class="trait"]' 'T' -// @has - '//*[@class="docblock"]' 'Docs associated with the S2 trait implementation.' -// @has - '//*[@class="docblock"]' 'Docs associated with the S2 trait a_method implementation.' -// @has - '//*[@class="docblock"]' 'Docs associated with the S2 trait c_method implementation.' -// @has - '//div[@class="impl-items"]//div[@class="docblock"]' 'Docs associated with the trait b_method definition.' +//@ has manual_impl/struct.S2.html '//*[@class="trait"]' 'T' +//@ has - '//*[@class="docblock"]' 'Docs associated with the S2 trait implementation.' +//@ has - '//*[@class="docblock"]' 'Docs associated with the S2 trait a_method implementation.' +//@ has - '//*[@class="docblock"]' 'Docs associated with the S2 trait c_method implementation.' +//@ has - '//div[@class="impl-items"]//div[@class="docblock"]' 'Docs associated with the trait b_method definition.' pub struct S2(usize); /// Docs associated with the S2 trait implementation. @@ -58,10 +58,10 @@ impl T for S2 { } } -// @has manual_impl/struct.S3.html '//*[@class="trait"]' 'T' -// @has - '//div[@class="docblock"]' 'Docs associated with the S3 trait implementation.' -// @has - '//div[@class="docblock"]' 'Docs associated with the S3 trait b_method implementation.' -// @has - '//div[@class="impl-items"]//div[@class="docblock"]' 'Docs associated with the trait a_method definition.' +//@ has manual_impl/struct.S3.html '//*[@class="trait"]' 'T' +//@ has - '//div[@class="docblock"]' 'Docs associated with the S3 trait implementation.' +//@ has - '//div[@class="docblock"]' 'Docs associated with the S3 trait b_method implementation.' +//@ has - '//div[@class="impl-items"]//div[@class="docblock"]' 'Docs associated with the trait a_method definition.' pub struct S3(usize); /// Docs associated with the S3 trait implementation. diff --git a/tests/rustdoc/markdown-table-escape-pipe-27862.rs b/tests/rustdoc/markdown-table-escape-pipe-27862.rs index 9af75d24888..bf4c75a97a8 100644 --- a/tests/rustdoc/markdown-table-escape-pipe-27862.rs +++ b/tests/rustdoc/markdown-table-escape-pipe-27862.rs @@ -4,4 +4,4 @@ /// Tests | Table /// ------|------------- /// t = b | id = \|x\| x -pub struct Foo; // @has issue_27862/struct.Foo.html //td 'id = |x| x' +pub struct Foo; //@ has issue_27862/struct.Foo.html //td 'id = |x| x' diff --git a/tests/rustdoc/masked.rs b/tests/rustdoc/masked.rs index 03e5e53f424..4f361ca881e 100644 --- a/tests/rustdoc/masked.rs +++ b/tests/rustdoc/masked.rs @@ -7,25 +7,25 @@ #[doc(masked)] extern crate masked; -// @!hasraw 'search-index.js' 'masked_method' +//@ !hasraw 'search-index.js' 'masked_method' -// @!hasraw 'foo/struct.String.html' 'MaskedTrait' -// @!hasraw 'foo/struct.String.html' 'MaskedBlanketTrait' -// @!hasraw 'foo/struct.String.html' 'masked_method' +//@ !hasraw 'foo/struct.String.html' 'MaskedTrait' +//@ !hasraw 'foo/struct.String.html' 'MaskedBlanketTrait' +//@ !hasraw 'foo/struct.String.html' 'masked_method' pub use std::string::String; -// @!hasraw 'foo/trait.Clone.html' 'MaskedStruct' +//@ !hasraw 'foo/trait.Clone.html' 'MaskedStruct' pub use std::clone::Clone; -// @!hasraw 'foo/struct.MyStruct.html' 'MaskedTrait' -// @!hasraw 'foo/struct.MyStruct.html' 'masked_method' +//@ !hasraw 'foo/struct.MyStruct.html' 'MaskedTrait' +//@ !hasraw 'foo/struct.MyStruct.html' 'masked_method' pub struct MyStruct; impl masked::MaskedTrait for MyStruct { fn masked_method() {} } -// @!hasraw 'foo/trait.MyTrait.html' 'MaskedStruct' +//@ !hasraw 'foo/trait.MyTrait.html' 'MaskedStruct' pub trait MyTrait {} impl MyTrait for masked::MaskedStruct {} diff --git a/tests/rustdoc/method-anchor-in-blanket-impl-86620.rs b/tests/rustdoc/method-anchor-in-blanket-impl-86620.rs index 537dadd2124..89e8712169a 100644 --- a/tests/rustdoc/method-anchor-in-blanket-impl-86620.rs +++ b/tests/rustdoc/method-anchor-in-blanket-impl-86620.rs @@ -6,6 +6,6 @@ extern crate issue_86620_1; use issue_86620_1::*; -// @!has foo/struct.S.html '//*[@id="method.vzip"]//a[@class="fnname"]/@href' #tymethod.vzip -// @has foo/struct.S.html '//*[@id="method.vzip"]//a[@class="anchor"]/@href' #method.vzip +//@ !has foo/struct.S.html '//*[@id="method.vzip"]//a[@class="fnname"]/@href' #tymethod.vzip +//@ has foo/struct.S.html '//*[@id="method.vzip"]//a[@class="anchor"]/@href' #method.vzip pub struct S; diff --git a/tests/rustdoc/method-link-foreign-trait-impl-17476.rs b/tests/rustdoc/method-link-foreign-trait-impl-17476.rs index 5f341e6c21c..cda828d3967 100644 --- a/tests/rustdoc/method-link-foreign-trait-impl-17476.rs +++ b/tests/rustdoc/method-link-foreign-trait-impl-17476.rs @@ -8,7 +8,7 @@ extern crate issue_17476; pub struct Foo; -// @has issue_17476/struct.Foo.html \ +//@ has issue_17476/struct.Foo.html \ // '//*[@href="http://example.com/issue_17476/trait.Foo.html#method.foo"]' \ // 'foo' impl issue_17476::Foo for Foo {} diff --git a/tests/rustdoc/method-list.rs b/tests/rustdoc/method-list.rs index 50f4af3aaaf..b7a0bc3c260 100644 --- a/tests/rustdoc/method-list.rs +++ b/tests/rustdoc/method-list.rs @@ -1,8 +1,8 @@ #![crate_name = "foo"] -// @has foo/struct.Foo.html -// @has - '//*[@class="sidebar-elems"]//section//a' 'super_long_name' -// @has - '//*[@class="sidebar-elems"]//section//a' 'Disp' +//@ has foo/struct.Foo.html +//@ has - '//*[@class="sidebar-elems"]//section//a' 'super_long_name' +//@ has - '//*[@class="sidebar-elems"]//section//a' 'Disp' pub struct Foo(usize); impl Foo { diff --git a/tests/rustdoc/mixing-doc-comments-and-attrs.rs b/tests/rustdoc/mixing-doc-comments-and-attrs.rs index 010058361fa..076a59c426b 100644 --- a/tests/rustdoc/mixing-doc-comments-and-attrs.rs +++ b/tests/rustdoc/mixing-doc-comments-and-attrs.rs @@ -1,15 +1,15 @@ #![crate_name = "foo"] -// @has 'foo/struct.S1.html' -// @snapshot S1_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]' +//@ has 'foo/struct.S1.html' +//@ snapshot S1_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]' #[doc = "Hello world!\n\n"] /// Goodbye! #[doc = " Hello again!\n"] pub struct S1; -// @has 'foo/struct.S2.html' -// @snapshot S2_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]' +//@ has 'foo/struct.S2.html' +//@ snapshot S2_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]' /// Hello world! /// @@ -17,8 +17,8 @@ pub struct S1; /// Hello again! pub struct S2; -// @has 'foo/struct.S3.html' -// @snapshot S3_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]' +//@ has 'foo/struct.S3.html' +//@ snapshot S3_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]' /** Par 1 */ /// /// Par 2 diff --git a/tests/rustdoc/module-impls.rs b/tests/rustdoc/module-impls.rs index 852f444e99b..b66721ecb13 100644 --- a/tests/rustdoc/module-impls.rs +++ b/tests/rustdoc/module-impls.rs @@ -2,4 +2,4 @@ pub use std::marker::Send; -// @!hasraw foo/index.html 'Implementations' +//@ !hasraw foo/index.html 'Implementations' diff --git a/tests/rustdoc/multiple-import-levels.rs b/tests/rustdoc/multiple-import-levels.rs index 29b67c6b2b1..ac00f1fbdfc 100644 --- a/tests/rustdoc/multiple-import-levels.rs +++ b/tests/rustdoc/multiple-import-levels.rs @@ -20,15 +20,15 @@ mod c { pub use crate::b::Type as Woof; } -// @has 'foo/struct.Type.html' -// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'foo 2 1' +//@ has 'foo/struct.Type.html' +//@ has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'foo 2 1' /// foo pub use b::Type; -// @has 'foo/struct.Whatever.html' -// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'whatever 3 2 1' +//@ has 'foo/struct.Whatever.html' +//@ has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'whatever 3 2 1' /// whatever pub use c::Type as Whatever; -// @has 'foo/struct.Woof.html' -// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'a dog 4 2 1' +//@ has 'foo/struct.Woof.html' +//@ has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'a dog 4 2 1' /// a dog pub use c::Woof; diff --git a/tests/rustdoc/multiple-macro-rules-w-same-name-submodule-99221.rs b/tests/rustdoc/multiple-macro-rules-w-same-name-submodule-99221.rs index ed1e42c1f4e..bf59788073e 100644 --- a/tests/rustdoc/multiple-macro-rules-w-same-name-submodule-99221.rs +++ b/tests/rustdoc/multiple-macro-rules-w-same-name-submodule-99221.rs @@ -10,7 +10,7 @@ extern crate issue_99221_aux; pub use issue_99221_aux::*; -// @count foo/index.html '//a[@class="macro"]' 1 +//@ count foo/index.html '//a[@class="macro"]' 1 mod inner { #[macro_export] diff --git a/tests/rustdoc/multiple-mods-w-same-name-doc-inline-83375.rs b/tests/rustdoc/multiple-mods-w-same-name-doc-inline-83375.rs index 9b3dfd45370..6d255ed6004 100644 --- a/tests/rustdoc/multiple-mods-w-same-name-doc-inline-83375.rs +++ b/tests/rustdoc/multiple-mods-w-same-name-doc-inline-83375.rs @@ -9,8 +9,8 @@ pub mod sub { } } -// @count foo/index.html '//a[@class="mod"][@title="mod foo::prelude"]' 1 -// @count foo/prelude/index.html '//div[@class="item-row"]' 0 +//@ count foo/index.html '//a[@class="mod"][@title="mod foo::prelude"]' 1 +//@ count foo/prelude/index.html '//div[@class="item-row"]' 0 pub mod prelude {} #[doc(inline)] diff --git a/tests/rustdoc/multiple-mods-w-same-name-doc-inline-last-item-83375.rs b/tests/rustdoc/multiple-mods-w-same-name-doc-inline-last-item-83375.rs index 7bad825b35f..a59b48232a3 100644 --- a/tests/rustdoc/multiple-mods-w-same-name-doc-inline-last-item-83375.rs +++ b/tests/rustdoc/multiple-mods-w-same-name-doc-inline-last-item-83375.rs @@ -12,6 +12,6 @@ pub mod sub { #[doc(inline)] pub use sub::*; -// @count foo/index.html '//a[@class="mod"][@title="mod foo::prelude"]' 1 -// @count foo/prelude/index.html '//div[@class="item-row"]' 0 +//@ count foo/index.html '//a[@class="mod"][@title="mod foo::prelude"]' 1 +//@ count foo/prelude/index.html '//div[@class="item-row"]' 0 pub mod prelude {} diff --git a/tests/rustdoc/must_implement_one_of.rs b/tests/rustdoc/must_implement_one_of.rs index 1f1dd5d5796..ab965bab356 100644 --- a/tests/rustdoc/must_implement_one_of.rs +++ b/tests/rustdoc/must_implement_one_of.rs @@ -2,7 +2,7 @@ #![feature(rustc_attrs)] #[rustc_must_implement_one_of(a, b)] -// @matches c/trait.Trait.html '//*[@class="stab must_implement"]' \ +//@ matches c/trait.Trait.html '//*[@class="stab must_implement"]' \ // 'At least one of the `a`, `b` methods is required.$' pub trait Trait { fn a() {} diff --git a/tests/rustdoc/mut-params.rs b/tests/rustdoc/mut-params.rs index e403b7b78c9..b3d4fe8c059 100644 --- a/tests/rustdoc/mut-params.rs +++ b/tests/rustdoc/mut-params.rs @@ -5,14 +5,14 @@ pub struct Foo; -// @count foo/struct.Foo.html '//*[@class="impl-items"]//*[@class="method"]' 2 -// @!has - '//*[@class="impl-items"]//*[@class="method"]' 'mut' +//@ count foo/struct.Foo.html '//*[@class="impl-items"]//*[@class="method"]' 2 +//@ !has - '//*[@class="impl-items"]//*[@class="method"]' 'mut' impl Foo { pub fn foo(mut self) {} pub fn bar(mut bar: ()) {} } -// @count foo/fn.baz.html '//pre[@class="rust item-decl"]' 1 -// @!has - '//pre[@class="rust item-decl"]' 'mut' +//@ count foo/fn.baz.html '//pre[@class="rust item-decl"]' 1 +//@ !has - '//pre[@class="rust item-decl"]' 'mut' pub fn baz(mut foo: Foo) {} diff --git a/tests/rustdoc/namespaces.rs b/tests/rustdoc/namespaces.rs index ad828e5ee3e..12248509d07 100644 --- a/tests/rustdoc/namespaces.rs +++ b/tests/rustdoc/namespaces.rs @@ -8,9 +8,9 @@ mod inner { pub fn sync() {} } -// @has namespaces/sync/index.html -// @has namespaces/fn.sync.html -// @has namespaces/index.html '//a/@href' 'sync/index.html' -// @has - '//a/@href' 'fn.sync.html' +//@ has namespaces/sync/index.html +//@ has namespaces/fn.sync.html +//@ has namespaces/index.html '//a/@href' 'sync/index.html' +//@ has - '//a/@href' 'fn.sync.html' #[doc(inline)] pub use inner::sync; diff --git a/tests/rustdoc/negative-impl-sidebar.rs b/tests/rustdoc/negative-impl-sidebar.rs index 4af6d008492..1742dce1945 100644 --- a/tests/rustdoc/negative-impl-sidebar.rs +++ b/tests/rustdoc/negative-impl-sidebar.rs @@ -3,7 +3,7 @@ pub struct Foo; -// @has foo/struct.Foo.html -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#trait-implementations"]' 'Trait Implementations' -// @has - '//*[@class="sidebar-elems"]//section//a' '!Sync' +//@ has foo/struct.Foo.html +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#trait-implementations"]' 'Trait Implementations' +//@ has - '//*[@class="sidebar-elems"]//section//a' '!Sync' impl !Sync for Foo {} diff --git a/tests/rustdoc/negative-impl.rs b/tests/rustdoc/negative-impl.rs index 51223af6737..f057a749b72 100644 --- a/tests/rustdoc/negative-impl.rs +++ b/tests/rustdoc/negative-impl.rs @@ -1,14 +1,14 @@ #![feature(negative_impls)] -// @matches negative_impl/struct.Alpha.html '//pre' "pub struct Alpha" +//@ matches negative_impl/struct.Alpha.html '//pre' "pub struct Alpha" pub struct Alpha; -// @matches negative_impl/struct.Bravo.html '//pre' "pub struct Bravo" +//@ matches negative_impl/struct.Bravo.html '//pre' "pub struct Bravo" pub struct Bravo(B); -// @matches negative_impl/struct.Alpha.html '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ matches negative_impl/struct.Alpha.html '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl !Send for Alpha" impl !Send for Alpha {} -// @matches negative_impl/struct.Bravo.html '//*[@class="impl"]//h3[@class="code-header"]' "\ +//@ matches negative_impl/struct.Bravo.html '//*[@class="impl"]//h3[@class="code-header"]' "\ // impl !Send for Bravo" impl !Send for Bravo {} diff --git a/tests/rustdoc/nested-items-issue-111415.rs b/tests/rustdoc/nested-items-issue-111415.rs index c117569d9b4..a5cd3ca0b1a 100644 --- a/tests/rustdoc/nested-items-issue-111415.rs +++ b/tests/rustdoc/nested-items-issue-111415.rs @@ -3,22 +3,22 @@ #![crate_name = "foo"] -// @has 'foo/index.html' +//@ has 'foo/index.html' // Checking there are only three sections. -// @count - '//*[@id="main-content"]/*[@class="section-header"]' 3 -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs' -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Functions' -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Traits' +//@ count - '//*[@id="main-content"]/*[@class="section-header"]' 3 +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs' +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Functions' +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Traits' // Checking that there are only three items. -// @count - '//*[@id="main-content"]//*[@class="item-name"]' 3 -// @has - '//*[@id="main-content"]//a[@href="struct.Bar.html"]' 'Bar' -// @has - '//*[@id="main-content"]//a[@href="fn.foo.html"]' 'foo' -// @has - '//*[@id="main-content"]//a[@href="trait.Foo.html"]' 'Foo' +//@ count - '//*[@id="main-content"]//*[@class="item-name"]' 3 +//@ has - '//*[@id="main-content"]//a[@href="struct.Bar.html"]' 'Bar' +//@ has - '//*[@id="main-content"]//a[@href="fn.foo.html"]' 'foo' +//@ has - '//*[@id="main-content"]//a[@href="trait.Foo.html"]' 'Foo' // Now checking that the `foo` method is visible in `Bar` page. -// @has 'foo/struct.Bar.html' -// @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'pub fn foo()' -// @has - '//*[@id="method.bar"]/*[@class="code-header"]' 'fn bar()' +//@ has 'foo/struct.Bar.html' +//@ has - '//*[@id="method.foo"]/*[@class="code-header"]' 'pub fn foo()' +//@ has - '//*[@id="method.bar"]/*[@class="code-header"]' 'fn bar()' pub struct Bar; pub trait Foo { diff --git a/tests/rustdoc/nested-modules.rs b/tests/rustdoc/nested-modules.rs index 12234d2cf7e..1e1d80e7e73 100644 --- a/tests/rustdoc/nested-modules.rs +++ b/tests/rustdoc/nested-modules.rs @@ -6,37 +6,37 @@ mod a_module { pub use a_module::private_function as other_private_function; pub mod a_nested_module { - // @has aCrate/a_nested_module/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function' - // @hasraw aCrate/a_nested_module/fn.a_nested_public_function.html 'pub fn a_nested_public_function()' + //@ has aCrate/a_nested_module/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function' + //@ hasraw aCrate/a_nested_module/fn.a_nested_public_function.html 'pub fn a_nested_public_function()' pub fn a_nested_public_function() {} - // @has aCrate/a_nested_module/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function' - // @hasraw aCrate/a_nested_module/fn.another_nested_public_function.html 'pub fn another_nested_public_function()' + //@ has aCrate/a_nested_module/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function' + //@ hasraw aCrate/a_nested_module/fn.another_nested_public_function.html 'pub fn another_nested_public_function()' pub use a_nested_module::a_nested_public_function as another_nested_public_function; } - // @!hasraw aCrate/a_nested_module/index.html 'yet_another_nested_public_function' + //@ !hasraw aCrate/a_nested_module/index.html 'yet_another_nested_public_function' pub use a_nested_module::a_nested_public_function as yet_another_nested_public_function; - // @!hasraw aCrate/a_nested_module/index.html 'one_last_nested_public_function' + //@ !hasraw aCrate/a_nested_module/index.html 'one_last_nested_public_function' pub use a_nested_module::another_nested_public_function as one_last_nested_public_function; } -// @!hasraw aCrate/index.html 'a_module' -// @has aCrate/index.html '//a[@href="a_nested_module/index.html"]' 'a_nested_module' +//@ !hasraw aCrate/index.html 'a_module' +//@ has aCrate/index.html '//a[@href="a_nested_module/index.html"]' 'a_nested_module' pub use a_module::a_nested_module; -// @has aCrate/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function' -// @has aCrate/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function' -// @has aCrate/index.html '//a[@href="fn.yet_another_nested_public_function.html"]' 'yet_another_nested_public_function' -// @has aCrate/index.html '//a[@href="fn.one_last_nested_public_function.html"]' 'one_last_nested_public_function' +//@ has aCrate/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function' +//@ has aCrate/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function' +//@ has aCrate/index.html '//a[@href="fn.yet_another_nested_public_function.html"]' 'yet_another_nested_public_function' +//@ has aCrate/index.html '//a[@href="fn.one_last_nested_public_function.html"]' 'one_last_nested_public_function' pub use a_module::{ a_nested_module::{a_nested_public_function, another_nested_public_function}, one_last_nested_public_function, yet_another_nested_public_function, }; -// @has aCrate/index.html '//a[@href="fn.private_function.html"]' 'private_function' -// @!hasraw aCrate/fn.private_function.html 'a_module' -// @has aCrate/index.html '//a[@href="fn.other_private_function.html"]' 'other_private_function' -// @!hasraw aCrate/fn.other_private_function.html 'a_module' +//@ has aCrate/index.html '//a[@href="fn.private_function.html"]' 'private_function' +//@ !hasraw aCrate/fn.private_function.html 'a_module' +//@ has aCrate/index.html '//a[@href="fn.other_private_function.html"]' 'other_private_function' +//@ !hasraw aCrate/fn.other_private_function.html 'a_module' pub use a_module::{other_private_function, private_function}; diff --git a/tests/rustdoc/no-compiler-reexport.rs b/tests/rustdoc/no-compiler-reexport.rs index d1567c4fdda..355d47d7ba7 100644 --- a/tests/rustdoc/no-compiler-reexport.rs +++ b/tests/rustdoc/no-compiler-reexport.rs @@ -2,6 +2,6 @@ #![crate_name = "foo"] -// @!has 'foo/index.html' '//code' 'extern crate std;' -// @!has 'foo/index.html' '//code' 'use std::prelude' +//@ !has 'foo/index.html' '//code' 'extern crate std;' +//@ !has 'foo/index.html' '//code' 'use std::prelude' pub struct Foo; diff --git a/tests/rustdoc/no-unit-struct-field.rs b/tests/rustdoc/no-unit-struct-field.rs index d301954b6b5..6ac44037cea 100644 --- a/tests/rustdoc/no-unit-struct-field.rs +++ b/tests/rustdoc/no-unit-struct-field.rs @@ -1,10 +1,10 @@ // This test ensures that the tuple struct fields are not generated in the // search index. -// @!hasraw search-index.js '"0"' -// @!hasraw search-index.js '"1"' -// @hasraw search-index.js '"foo_a"' -// @hasraw search-index.js '"bar_a"' +//@ !hasraw search-index.js '"0"' +//@ !hasraw search-index.js '"1"' +//@ hasraw search-index.js '"foo_a"' +//@ hasraw search-index.js '"bar_a"' pub struct Bar(pub u32, pub u8); pub struct Foo { diff --git a/tests/rustdoc/no_std-primitive.rs b/tests/rustdoc/no_std-primitive.rs index 22fd392dd36..78076a601de 100644 --- a/tests/rustdoc/no_std-primitive.rs +++ b/tests/rustdoc/no_std-primitive.rs @@ -1,6 +1,6 @@ #![no_std] /// Link to [intra-doc link][u8] -// @has 'no_std_primitive/fn.foo.html' '//a[@href="{{channel}}/core/primitive.u8.html"]' 'intra-doc link' -// @has - '//a[@href="{{channel}}/core/primitive.u8.html"]' 'u8' +//@ has 'no_std_primitive/fn.foo.html' '//a[@href="{{channel}}/core/primitive.u8.html"]' 'intra-doc link' +//@ has - '//a[@href="{{channel}}/core/primitive.u8.html"]' 'u8' pub fn foo() -> u8 {} diff --git a/tests/rustdoc/non_lifetime_binders.rs b/tests/rustdoc/non_lifetime_binders.rs index da9a4e6a84d..34e83a78787 100644 --- a/tests/rustdoc/non_lifetime_binders.rs +++ b/tests/rustdoc/non_lifetime_binders.rs @@ -5,5 +5,5 @@ pub trait Trait {} pub struct Wrapper(Box); -// @has non_lifetime_binders/fn.foo.html '//pre' "fn foo()where for<'a, T> &'a Wrapper: Trait" +//@ has non_lifetime_binders/fn.foo.html '//pre' "fn foo()where for<'a, T> &'a Wrapper: Trait" pub fn foo() where for<'a, T> &'a Wrapper: Trait {} diff --git a/tests/rustdoc/normalize-assoc-item.rs b/tests/rustdoc/normalize-assoc-item.rs index d45bb1bff65..7ef9d3067e1 100644 --- a/tests/rustdoc/normalize-assoc-item.rs +++ b/tests/rustdoc/normalize-assoc-item.rs @@ -19,20 +19,20 @@ impl Trait for isize { type X = <() as Trait>::X; } -// @has 'normalize_assoc_item/fn.f.html' '//pre[@class="rust item-decl"]' 'pub fn f() -> isize' +//@ has 'normalize_assoc_item/fn.f.html' '//pre[@class="rust item-decl"]' 'pub fn f() -> isize' pub fn f() -> ::X { 0 } -// @has 'normalize_assoc_item/fn.f2.html' '//pre[@class="rust item-decl"]' 'pub fn f2() -> fn() -> i32' +//@ has 'normalize_assoc_item/fn.f2.html' '//pre[@class="rust item-decl"]' 'pub fn f2() -> fn() -> i32' pub fn f2() -> ::X { todo!() } pub struct S { - // @has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.box_me_up"]' 'box_me_up: Box' + //@ has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.box_me_up"]' 'box_me_up: Box' pub box_me_up: ::X, - // @has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.generic"]' 'generic: (usize, isize)' + //@ has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.generic"]' 'generic: (usize, isize)' pub generic: as Trait>::X, } @@ -49,10 +49,10 @@ impl Trait for Generic { // These can't be normalized because they depend on a generic parameter. // However the user can choose whether the text should be displayed as `Inner::X` or `::X`. -// @has 'normalize_assoc_item/struct.Unknown.html' '//pre[@class="rust item-decl"]' 'pub struct Unknown(pub ::X);' +//@ has 'normalize_assoc_item/struct.Unknown.html' '//pre[@class="rust item-decl"]' 'pub struct Unknown(pub ::X);' pub struct Unknown(pub ::X); -// @has 'normalize_assoc_item/struct.Unknown2.html' '//pre[@class="rust item-decl"]' 'pub struct Unknown2(pub Inner::X);' +//@ has 'normalize_assoc_item/struct.Unknown2.html' '//pre[@class="rust item-decl"]' 'pub struct Unknown2(pub Inner::X);' pub struct Unknown2(pub Inner::X); trait Lifetimes<'a> { @@ -63,20 +63,20 @@ impl<'a> Lifetimes<'a> for usize { type Y = &'a isize; } -// @has 'normalize_assoc_item/fn.g.html' '//pre[@class="rust item-decl"]' "pub fn g() -> &'static isize" +//@ has 'normalize_assoc_item/fn.g.html' '//pre[@class="rust item-decl"]' "pub fn g() -> &'static isize" pub fn g() -> >::Y { &0 } -// @has 'normalize_assoc_item/constant.A.html' '//pre[@class="rust item-decl"]' "pub const A: &'static isize" +//@ has 'normalize_assoc_item/constant.A.html' '//pre[@class="rust item-decl"]' "pub const A: &'static isize" pub const A: >::Y = &0; // test cross-crate re-exports extern crate inner; -// @has 'normalize_assoc_item/fn.foo.html' '//pre[@class="rust item-decl"]' "pub fn foo() -> i32" +//@ has 'normalize_assoc_item/fn.foo.html' '//pre[@class="rust item-decl"]' "pub fn foo() -> i32" pub use inner::foo; -// @has 'normalize_assoc_item/fn.h.html' '//pre[@class="rust item-decl"]' "pub fn h() -> IntoIter" +//@ has 'normalize_assoc_item/fn.h.html' '//pre[@class="rust item-decl"]' "pub fn h() -> IntoIter" pub fn h() -> as IntoIterator>::IntoIter { vec![].into_iter() } diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs index 5af5f7616b5..043d787396d 100644 --- a/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs +++ b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs @@ -16,8 +16,8 @@ /// that are implemented on foreign types don't show up. mod reference {} -// @has doc_notable_trait_mut_t_is_not_an_iterator/fn.fn_no_matches.html -// @!has - '//code[@class="content"]' 'Iterator' +//@ has doc_notable_trait_mut_t_is_not_an_iterator/fn.fn_no_matches.html +//@ !has - '//code[@class="content"]' 'Iterator' pub fn fn_no_matches<'a, T: 'a>() -> &'a mut T { panic!() } diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs index 6c980aaa2b1..6a9fbb9ac0b 100644 --- a/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs +++ b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs @@ -14,8 +14,8 @@ /// that are implemented on foreign types don't show up. mod reference {} -// @has doc_notable_trait_mut_t_is_not_ref_t/fn.fn_no_matches.html -// @!has - '//code[@class="content"]' "impl<'_, I> Iterator for &'_ mut I" +//@ has doc_notable_trait_mut_t_is_not_ref_t/fn.fn_no_matches.html +//@ !has - '//code[@class="content"]' "impl<'_, I> Iterator for &'_ mut I" pub fn fn_no_matches<'a, T: Iterator + 'a>() -> &'a T { loop {} } diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-negative.rs b/tests/rustdoc/notable-trait/doc-notable_trait-negative.rs index 2bbe0a3ef8c..feb40b3797b 100644 --- a/tests/rustdoc/notable-trait/doc-notable_trait-negative.rs +++ b/tests/rustdoc/notable-trait/doc-notable_trait-negative.rs @@ -9,14 +9,14 @@ impl SomeTrait for Positive {} pub struct Negative; impl !SomeTrait for Negative {} -// @has doc_notable_trait_negative/fn.positive.html -// @snapshot positive - '//script[@id="notable-traits-data"]' +//@ has doc_notable_trait_negative/fn.positive.html +//@ snapshot positive - '//script[@id="notable-traits-data"]' pub fn positive() -> Positive { todo!() } -// @has doc_notable_trait_negative/fn.negative.html -// @count - '//script[@id="notable-traits-data"]' 0 +//@ has doc_notable_trait_negative/fn.negative.html +//@ count - '//script[@id="notable-traits-data"]' 0 pub fn negative() -> Negative { &[] } diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs b/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs index ef206710b4b..f89f582a4bb 100644 --- a/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs +++ b/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs @@ -7,20 +7,20 @@ pub struct SomeStruct; pub struct OtherStruct; impl SomeTrait for &[SomeStruct] {} -// @has doc_notable_trait_slice/fn.bare_fn_matches.html -// @snapshot bare_fn_matches - '//script[@id="notable-traits-data"]' +//@ has doc_notable_trait_slice/fn.bare_fn_matches.html +//@ snapshot bare_fn_matches - '//script[@id="notable-traits-data"]' pub fn bare_fn_matches() -> &'static [SomeStruct] { &[] } -// @has doc_notable_trait_slice/fn.bare_fn_no_matches.html -// @count - '//script[@id="notable-traits-data"]' 0 +//@ has doc_notable_trait_slice/fn.bare_fn_no_matches.html +//@ count - '//script[@id="notable-traits-data"]' 0 pub fn bare_fn_no_matches() -> &'static [OtherStruct] { &[] } -// @has doc_notable_trait_slice/fn.bare_fn_mut_no_matches.html -// @count - '//script[@id="notable-traits-data"]' 0 +//@ has doc_notable_trait_slice/fn.bare_fn_mut_no_matches.html +//@ count - '//script[@id="notable-traits-data"]' 0 pub fn bare_fn_mut_no_matches() -> &'static mut [SomeStruct] { &mut [] } diff --git a/tests/rustdoc/notable-trait/doc-notable_trait.rs b/tests/rustdoc/notable-trait/doc-notable_trait.rs index d8941769fa6..83fe6172e94 100644 --- a/tests/rustdoc/notable-trait/doc-notable_trait.rs +++ b/tests/rustdoc/notable-trait/doc-notable_trait.rs @@ -8,9 +8,9 @@ impl SomeTrait for Wrapper {} #[doc(notable_trait)] pub trait SomeTrait { - // @has doc_notable_trait/trait.SomeTrait.html - // @has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper' - // @snapshot wrap-me - '//script[@id="notable-traits-data"]' + //@ has doc_notable_trait/trait.SomeTrait.html + //@ has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper' + //@ snapshot wrap-me - '//script[@id="notable-traits-data"]' fn wrap_me(self) -> Wrapper where Self: Sized { Wrapper { inner: self, @@ -22,17 +22,17 @@ pub struct SomeStruct; impl SomeTrait for SomeStruct {} impl SomeStruct { - // @has doc_notable_trait/struct.SomeStruct.html - // @has - '//a[@class="tooltip"]/@data-notable-ty' 'SomeStruct' - // @snapshot some-struct-new - '//script[@id="notable-traits-data"]' + //@ has doc_notable_trait/struct.SomeStruct.html + //@ has - '//a[@class="tooltip"]/@data-notable-ty' 'SomeStruct' + //@ snapshot some-struct-new - '//script[@id="notable-traits-data"]' pub fn new() -> SomeStruct { SomeStruct } } -// @has doc_notable_trait/fn.bare_fn.html -// @has - '//a[@class="tooltip"]/@data-notable-ty' 'SomeStruct' -// @snapshot bare-fn - '//script[@id="notable-traits-data"]' +//@ has doc_notable_trait/fn.bare_fn.html +//@ has - '//a[@class="tooltip"]/@data-notable-ty' 'SomeStruct' +//@ snapshot bare-fn - '//script[@id="notable-traits-data"]' pub fn bare_fn() -> SomeStruct { SomeStruct } diff --git a/tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs b/tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs index 6b94d799483..dcdcbfb7ec1 100644 --- a/tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs +++ b/tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs @@ -30,12 +30,12 @@ impl Pin { impl FakeIterator for Pin {} -// @!has doc_notable_trait_box_is_not_an_iterator/fn.foo.html '//*' 'Notable' +//@ !has doc_notable_trait_box_is_not_an_iterator/fn.foo.html '//*' 'Notable' pub fn foo(x: T) -> Box { Box::new(x) } -// @!has doc_notable_trait_box_is_not_an_iterator/fn.bar.html '//*' 'Notable' +//@ !has doc_notable_trait_box_is_not_an_iterator/fn.bar.html '//*' 'Notable' pub fn bar(x: T) -> Pin { Pin::new(x) } diff --git a/tests/rustdoc/notable-trait/notable-trait-generics.rs b/tests/rustdoc/notable-trait/notable-trait-generics.rs index 611902abad6..60d09661aff 100644 --- a/tests/rustdoc/notable-trait/notable-trait-generics.rs +++ b/tests/rustdoc/notable-trait/notable-trait-generics.rs @@ -10,8 +10,8 @@ pub mod generic_return { impl NotableTrait for Wrapper {} - // @has notable_trait_generics/generic_return/fn.returning.html - // @!has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper' + //@ has notable_trait_generics/generic_return/fn.returning.html + //@ !has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper' pub fn returning() -> Wrapper { loop {} } @@ -27,8 +27,8 @@ pub mod generic_impl { impl NotableTrait for Wrapper {} - // @has notable_trait_generics/generic_impl/fn.returning.html - // @has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper' + //@ has notable_trait_generics/generic_impl/fn.returning.html + //@ has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper' pub fn returning() -> Wrapper { loop {} } diff --git a/tests/rustdoc/notable-trait/spotlight-from-dependency.rs b/tests/rustdoc/notable-trait/spotlight-from-dependency.rs index 426759c7bf8..992102f87c7 100644 --- a/tests/rustdoc/notable-trait/spotlight-from-dependency.rs +++ b/tests/rustdoc/notable-trait/spotlight-from-dependency.rs @@ -2,9 +2,9 @@ use std::iter::Iterator; -// @has foo/struct.Odd.html -// @has - '//*[@id="method.new"]//a[@class="tooltip"]/@data-notable-ty' 'Odd' -// @snapshot odd - '//script[@id="notable-traits-data"]' +//@ has foo/struct.Odd.html +//@ has - '//*[@id="method.new"]//a[@class="tooltip"]/@data-notable-ty' 'Odd' +//@ snapshot odd - '//script[@id="notable-traits-data"]' pub struct Odd { current: usize, } diff --git a/tests/rustdoc/nul-error.rs b/tests/rustdoc/nul-error.rs index e8aa786534b..54688efc48c 100644 --- a/tests/rustdoc/nul-error.rs +++ b/tests/rustdoc/nul-error.rs @@ -3,6 +3,6 @@ #![crate_name = "foo"] -// @has foo/fn.foo.html '//code' '' +//@ has foo/fn.foo.html '//code' '' #[doc = "Attempted to pass a string containing `\0`"] pub fn foo() {} diff --git a/tests/rustdoc/playground-arg.rs b/tests/rustdoc/playground-arg.rs index 58d87c653b4..5875451a859 100644 --- a/tests/rustdoc/playground-arg.rs +++ b/tests/rustdoc/playground-arg.rs @@ -10,4 +10,4 @@ pub fn dummy() {} // ensure that `extern crate foo;` was inserted into code snips automatically: -// @matches foo/index.html '//a[@class="test-arrow"][@href="https://example.com/?code=%23!%5Ballow(unused)%5D%0A%23%5Ballow(unused_extern_crates)%5D%0Aextern+crate+r%23foo;%0Afn+main()+%7B%0A++++use+foo::dummy;%0A++++dummy();%0A%7D&edition=2015"]' "Run" +//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://example.com/?code=%23!%5Ballow(unused)%5D%0A%23%5Ballow(unused_extern_crates)%5D%0Aextern+crate+r%23foo;%0Afn+main()+%7B%0A++++use+foo::dummy;%0A++++dummy();%0A%7D&edition=2015"]' "Run" diff --git a/tests/rustdoc/playground-empty.rs b/tests/rustdoc/playground-empty.rs index bfba9ffdbf4..61c422c436b 100644 --- a/tests/rustdoc/playground-empty.rs +++ b/tests/rustdoc/playground-empty.rs @@ -10,4 +10,4 @@ //! println!("Hello, world!"); //! ``` -// @!has foo/index.html '//a[@class="test-arrow"]' "Run" +//@ !has foo/index.html '//a[@class="test-arrow"]' "Run" diff --git a/tests/rustdoc/playground-none.rs b/tests/rustdoc/playground-none.rs index ff51c68d8a2..924c0525190 100644 --- a/tests/rustdoc/playground-none.rs +++ b/tests/rustdoc/playground-none.rs @@ -6,4 +6,4 @@ //! println!("Hello, world!"); //! ``` -// @!has foo/index.html '//a[@class="test-arrow"]' "Run" +//@ !has foo/index.html '//a[@class="test-arrow"]' "Run" diff --git a/tests/rustdoc/playground-syntax-error.rs b/tests/rustdoc/playground-syntax-error.rs index 8918ae874f8..f5067145e02 100644 --- a/tests/rustdoc/playground-syntax-error.rs +++ b/tests/rustdoc/playground-syntax-error.rs @@ -16,6 +16,6 @@ /// ``` pub fn bar() {} -// @has foo/fn.bar.html -// @has - '//a[@class="test-arrow"]' "Run" -// @has - '//*[@class="docblock"]' 'foo_recursive' +//@ has foo/fn.bar.html +//@ has - '//a[@class="test-arrow"]' "Run" +//@ has - '//*[@class="docblock"]' 'foo_recursive' diff --git a/tests/rustdoc/playground.rs b/tests/rustdoc/playground.rs index a2fc9eb7387..7880f779067 100644 --- a/tests/rustdoc/playground.rs +++ b/tests/rustdoc/playground.rs @@ -22,6 +22,6 @@ //! } //! ``` -// @matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&edition=2015"]' "Run" -// @matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&edition=2015"]' "Run" -// @matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(something)%5D%0A%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&version=nightly&edition=2015"]' "Run" +//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&edition=2015"]' "Run" +//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&edition=2015"]' "Run" +//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(something)%5D%0A%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&version=nightly&edition=2015"]' "Run" diff --git a/tests/rustdoc/primitive-link.rs b/tests/rustdoc/primitive-link.rs index 125e0c84973..3fe9cdc3ca7 100644 --- a/tests/rustdoc/primitive-link.rs +++ b/tests/rustdoc/primitive-link.rs @@ -1,12 +1,12 @@ #![crate_name = "foo"] -// @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="{{channel}}/std/primitive.u32.html"]' 'u32' -// @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="{{channel}}/std/primitive.i64.html"]' 'i64' -// @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="{{channel}}/std/primitive.i32.html"]' 'std::primitive::i32' -// @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="{{channel}}/std/primitive.str.html"]' 'std::primitive::str' +//@ has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="{{channel}}/std/primitive.u32.html"]' 'u32' +//@ has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="{{channel}}/std/primitive.i64.html"]' 'i64' +//@ has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="{{channel}}/std/primitive.i32.html"]' 'std::primitive::i32' +//@ has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="{{channel}}/std/primitive.str.html"]' 'std::primitive::str' -// @has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="{{channel}}/std/primitive.i32.html#associatedconstant.MAX"]' 'std::primitive::i32::MAX' +//@ has foo/struct.Foo.html '//*[@class="docblock"]/p/a[@href="{{channel}}/std/primitive.i32.html#associatedconstant.MAX"]' 'std::primitive::i32::MAX' /// It contains [`u32`] and [i64]. /// It also links to [std::primitive::i32], [std::primitive::str], diff --git a/tests/rustdoc/primitive-raw-pointer-dox-15318-3.rs b/tests/rustdoc/primitive-raw-pointer-dox-15318-3.rs index 80c55975687..5520abf2925 100644 --- a/tests/rustdoc/primitive-raw-pointer-dox-15318-3.rs +++ b/tests/rustdoc/primitive-raw-pointer-dox-15318-3.rs @@ -2,7 +2,7 @@ #![crate_name="issue_15318_3"] #![feature(rustc_attrs)] -// @has issue_15318_3/primitive.pointer.html +//@ has issue_15318_3/primitive.pointer.html /// dox #[rustc_doc_primitive = "pointer"] diff --git a/tests/rustdoc/primitive-raw-pointer-link-15318.rs b/tests/rustdoc/primitive-raw-pointer-link-15318.rs index 66d84e9aaa3..a6f6f67dc84 100644 --- a/tests/rustdoc/primitive-raw-pointer-link-15318.rs +++ b/tests/rustdoc/primitive-raw-pointer-link-15318.rs @@ -7,7 +7,7 @@ extern crate issue_15318; -// @has issue_15318/fn.bar.html \ +//@ has issue_15318/fn.bar.html \ // '//*[@href="http://example.com/issue_15318/primitive.pointer.html"]' \ // '*mut T' pub fn bar(ptr: *mut T) {} diff --git a/tests/rustdoc/primitive-raw-pointer-link-no-inlined-15318-2.rs b/tests/rustdoc/primitive-raw-pointer-link-no-inlined-15318-2.rs index e6c69c3407e..16b007e8bbd 100644 --- a/tests/rustdoc/primitive-raw-pointer-link-no-inlined-15318-2.rs +++ b/tests/rustdoc/primitive-raw-pointer-link-no-inlined-15318-2.rs @@ -9,7 +9,7 @@ extern crate issue_15318; pub use issue_15318::ptr; -// @!has issue_15318_2/fn.bar.html \ +//@ !has issue_15318_2/fn.bar.html \ // '//*[@href="primitive.pointer.html"]' \ // '*mut T' pub fn bar(ptr: *mut T) {} diff --git a/tests/rustdoc/primitive-reexport.rs b/tests/rustdoc/primitive-reexport.rs index 7dbb7c6db50..eb255745392 100644 --- a/tests/rustdoc/primitive-reexport.rs +++ b/tests/rustdoc/primitive-reexport.rs @@ -3,26 +3,26 @@ #![crate_name = "bar"] -// @has bar/p/index.html -// @has - '//code' 'pub use bool;' -// @has - '//code/a[@href="{{channel}}/std/primitive.bool.html"]' 'bool' -// @has - '//code' 'pub use char as my_char;' -// @has - '//code/a[@href="{{channel}}/std/primitive.char.html"]' 'char' +//@ has bar/p/index.html +//@ has - '//code' 'pub use bool;' +//@ has - '//code/a[@href="{{channel}}/std/primitive.bool.html"]' 'bool' +//@ has - '//code' 'pub use char as my_char;' +//@ has - '//code/a[@href="{{channel}}/std/primitive.char.html"]' 'char' pub mod p { pub use foo::bar::*; } -// @has bar/baz/index.html -// @has - '//code' 'pub use bool;' -// @has - '//code/a[@href="{{channel}}/std/primitive.bool.html"]' 'bool' -// @has - '//code' 'pub use char as my_char;' -// @has - '//code/a[@href="{{channel}}/std/primitive.char.html"]' 'char' +//@ has bar/baz/index.html +//@ has - '//code' 'pub use bool;' +//@ has - '//code/a[@href="{{channel}}/std/primitive.bool.html"]' 'bool' +//@ has - '//code' 'pub use char as my_char;' +//@ has - '//code/a[@href="{{channel}}/std/primitive.char.html"]' 'char' pub use foo::bar as baz; -// @has bar/index.html -// @has - '//code' 'pub use str;' -// @has - '//code/a[@href="{{channel}}/std/primitive.str.html"]' 'str' -// @has - '//code' 'pub use i32 as my_i32;' -// @has - '//code/a[@href="{{channel}}/std/primitive.i32.html"]' 'i32' +//@ has bar/index.html +//@ has - '//code' 'pub use str;' +//@ has - '//code/a[@href="{{channel}}/std/primitive.str.html"]' 'str' +//@ has - '//code' 'pub use i32 as my_i32;' +//@ has - '//code/a[@href="{{channel}}/std/primitive.i32.html"]' 'i32' pub use str; pub use i32 as my_i32; diff --git a/tests/rustdoc/primitive-reference.rs b/tests/rustdoc/primitive-reference.rs index 6f034224df5..c12d65ee0c5 100644 --- a/tests/rustdoc/primitive-reference.rs +++ b/tests/rustdoc/primitive-reference.rs @@ -2,19 +2,19 @@ #![feature(rustc_attrs)] -// @has foo/index.html -// @has - '//h2[@id="primitives"]' 'Primitive Types' -// @has - '//a[@href="primitive.reference.html"]' 'reference' -// @has - '//div[@class="sidebar-elems"]//li/a' 'Primitive Types' -// @has - '//div[@class="sidebar-elems"]//li/a/@href' '#primitives' -// @has foo/primitive.reference.html -// @has - '//a[@class="primitive"]' 'reference' -// @has - '//h1' 'Primitive Type reference' -// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' +//@ has foo/index.html +//@ has - '//h2[@id="primitives"]' 'Primitive Types' +//@ has - '//a[@href="primitive.reference.html"]' 'reference' +//@ has - '//div[@class="sidebar-elems"]//li/a' 'Primitive Types' +//@ has - '//div[@class="sidebar-elems"]//li/a/@href' '#primitives' +//@ has foo/primitive.reference.html +//@ has - '//a[@class="primitive"]' 'reference' +//@ has - '//h1' 'Primitive Type reference' +//@ has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' // There should be only one implementation listed. -// @count - '//*[@class="impl"]' 1 -// @has - '//*[@id="impl-Foo%3C%26A%3E-for-%26B"]/*[@class="code-header"]' \ +//@ count - '//*[@class="impl"]' 1 +//@ has - '//*[@id="impl-Foo%3C%26A%3E-for-%26B"]/*[@class="code-header"]' \ // 'impl Foo<&A> for &B' #[rustc_doc_primitive = "reference"] /// this is a test! diff --git a/tests/rustdoc/primitive-slice-auto-trait.rs b/tests/rustdoc/primitive-slice-auto-trait.rs index 359a08f6a31..a877b73cf9f 100644 --- a/tests/rustdoc/primitive-slice-auto-trait.rs +++ b/tests/rustdoc/primitive-slice-auto-trait.rs @@ -3,12 +3,12 @@ #![crate_name = "foo"] #![feature(rustc_attrs)] -// @has foo/primitive.slice.html '//a[@class="primitive"]' 'slice' -// @has - '//h1' 'Primitive Type slice' -// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' -// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations' -// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Send for [T]where T: Send' -// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Sync for [T]where T: Sync' +//@ has foo/primitive.slice.html '//a[@class="primitive"]' 'slice' +//@ has - '//h1' 'Primitive Type slice' +//@ has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' +//@ has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations' +//@ has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Send for [T]where T: Send' +//@ has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Sync for [T]where T: Sync' #[rustc_doc_primitive = "slice"] /// this is a test! mod slice_prim {} diff --git a/tests/rustdoc/primitive-tuple-auto-trait.rs b/tests/rustdoc/primitive-tuple-auto-trait.rs index 79737da3a2d..060c4ecfbdc 100644 --- a/tests/rustdoc/primitive-tuple-auto-trait.rs +++ b/tests/rustdoc/primitive-tuple-auto-trait.rs @@ -3,17 +3,17 @@ #![crate_name = "foo"] #![feature(rustc_attrs)] -// @has foo/primitive.tuple.html '//a[@class="primitive"]' 'tuple' -// @has - '//h1' 'Primitive Type tuple' -// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' -// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations' -// @has - '//div[@id="synthetic-implementations-list"]//h3' 'Send' -// @has - '//div[@id="synthetic-implementations-list"]//h3' 'Sync' +//@ has foo/primitive.tuple.html '//a[@class="primitive"]' 'tuple' +//@ has - '//h1' 'Primitive Type tuple' +//@ has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' +//@ has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations' +//@ has - '//div[@id="synthetic-implementations-list"]//h3' 'Send' +//@ has - '//div[@id="synthetic-implementations-list"]//h3' 'Sync' #[rustc_doc_primitive = "tuple"] /// this is a test! /// // Hardcoded anchor to header written in library/core/src/primitive_docs.rs -// @has - '//h2[@id="trait-implementations-1"]' 'Trait implementations' +//@ has - '//h2[@id="trait-implementations-1"]' 'Trait implementations' /// # Trait implementations /// /// This header is hard-coded in the HTML format linking for `#[doc(fake_variadics)]`. diff --git a/tests/rustdoc/primitive-tuple-variadic.rs b/tests/rustdoc/primitive-tuple-variadic.rs index 546cf2ace42..4b2fb786a89 100644 --- a/tests/rustdoc/primitive-tuple-variadic.rs +++ b/tests/rustdoc/primitive-tuple-variadic.rs @@ -5,14 +5,14 @@ pub trait Foo {} -// @has foo/trait.Foo.html -// @has - '//section[@id="impl-Foo-for-(T,)"]/h3' 'impl Foo for (T₁, T₂, …, Tₙ)' +//@ has foo/trait.Foo.html +//@ has - '//section[@id="impl-Foo-for-(T,)"]/h3' 'impl Foo for (T₁, T₂, …, Tₙ)' #[doc(fake_variadic)] impl Foo for (T,) {} pub trait Bar {} -// @has foo/trait.Bar.html -// @has - '//section[@id="impl-Bar-for-(U,)"]/h3' 'impl Bar for (U₁, U₂, …, Uₙ)' +//@ has foo/trait.Bar.html +//@ has - '//section[@id="impl-Bar-for-(U,)"]/h3' 'impl Bar for (U₁, U₂, …, Uₙ)' #[doc(fake_variadic)] impl Bar for (U,) {} diff --git a/tests/rustdoc/primitive-unit-auto-trait.rs b/tests/rustdoc/primitive-unit-auto-trait.rs index ff86a555cda..7751a2bf1d0 100644 --- a/tests/rustdoc/primitive-unit-auto-trait.rs +++ b/tests/rustdoc/primitive-unit-auto-trait.rs @@ -3,12 +3,12 @@ #![crate_name = "foo"] #![feature(rustc_attrs)] -// @has foo/primitive.unit.html '//a[@class="primitive"]' 'unit' -// @has - '//h1' 'Primitive Type unit' -// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' -// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations' -// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Send for ()' -// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Sync for ()' +//@ has foo/primitive.unit.html '//a[@class="primitive"]' 'unit' +//@ has - '//h1' 'Primitive Type unit' +//@ has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' +//@ has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations' +//@ has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Send for ()' +//@ has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Sync for ()' #[rustc_doc_primitive = "unit"] /// this is a test! mod unit_prim {} diff --git a/tests/rustdoc/primitive/no_std.rs b/tests/rustdoc/primitive/no_std.rs index f0f70cb6c18..b3d47e7384b 100644 --- a/tests/rustdoc/primitive/no_std.rs +++ b/tests/rustdoc/primitive/no_std.rs @@ -2,8 +2,8 @@ #![deny(warnings)] #![deny(rustdoc::broken_intra_doc_links)] -// @has no_std/fn.foo.html '//a/[@href="{{channel}}/core/primitive.u8.html"]' 'u8' -// @has no_std/fn.foo.html '//a/[@href="{{channel}}/core/primitive.u8.html"]' 'primitive link' +//@ has no_std/fn.foo.html '//a/[@href="{{channel}}/core/primitive.u8.html"]' 'u8' +//@ has no_std/fn.foo.html '//a/[@href="{{channel}}/core/primitive.u8.html"]' 'primitive link' /// Link to [primitive link][u8] pub fn foo() -> u8 {} diff --git a/tests/rustdoc/primitive/primitive-generic-impl.rs b/tests/rustdoc/primitive/primitive-generic-impl.rs index 558336d7316..b342e977cf0 100644 --- a/tests/rustdoc/primitive/primitive-generic-impl.rs +++ b/tests/rustdoc/primitive/primitive-generic-impl.rs @@ -1,7 +1,7 @@ #![feature(rustc_attrs)] #![crate_name = "foo"] -// @has foo/primitive.i32.html '//*[@id="impl-ToString-for-T"]//h3[@class="code-header"]' 'impl ToString for T' +//@ has foo/primitive.i32.html '//*[@id="impl-ToString-for-T"]//h3[@class="code-header"]' 'impl ToString for T' #[rustc_doc_primitive = "i32"] /// Some useless docs, wouhou! diff --git a/tests/rustdoc/primitive/primitive.rs b/tests/rustdoc/primitive/primitive.rs index 4b89fd9dfb7..b54c3dd1cd6 100644 --- a/tests/rustdoc/primitive/primitive.rs +++ b/tests/rustdoc/primitive/primitive.rs @@ -4,30 +4,30 @@ #![feature(f16)] #![feature(f128)] -// @has foo/index.html '//h2[@id="primitives"]' 'Primitive Types' -// @has foo/index.html '//a[@href="primitive.i32.html"]' 'i32' -// @has foo/index.html '//div[@class="sidebar-elems"]//li/a' 'Primitive Types' -// @has foo/index.html '//div[@class="sidebar-elems"]//li/a/@href' '#primitives' -// @has foo/primitive.i32.html '//a[@class="primitive"]' 'i32' -// @has foo/primitive.i32.html '//h1' 'Primitive Type i32' -// @has foo/primitive.i32.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' -// @has foo/index.html '//a/@href' '../foo/index.html' -// @!has foo/index.html '//span' '🔒' +//@ has foo/index.html '//h2[@id="primitives"]' 'Primitive Types' +//@ has foo/index.html '//a[@href="primitive.i32.html"]' 'i32' +//@ has foo/index.html '//div[@class="sidebar-elems"]//li/a' 'Primitive Types' +//@ has foo/index.html '//div[@class="sidebar-elems"]//li/a/@href' '#primitives' +//@ has foo/primitive.i32.html '//a[@class="primitive"]' 'i32' +//@ has foo/primitive.i32.html '//h1' 'Primitive Type i32' +//@ has foo/primitive.i32.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!' +//@ has foo/index.html '//a/@href' '../foo/index.html' +//@ !has foo/index.html '//span' '🔒' #[rustc_doc_primitive = "i32"] /// this is a test! mod i32 {} -// @has foo/primitive.bool.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello' +//@ has foo/primitive.bool.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello' #[rustc_doc_primitive = "bool"] /// hello mod bool {} -// @has foo/primitive.f16.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello' +//@ has foo/primitive.f16.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello' #[rustc_doc_primitive = "f16"] /// hello mod f16 {} -// @has foo/primitive.f128.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello' +//@ has foo/primitive.f128.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'hello' #[rustc_doc_primitive = "f128"] /// hello mod f128 {} diff --git a/tests/rustdoc/private-fields-tuple-struct.rs b/tests/rustdoc/private-fields-tuple-struct.rs index c6989dd8cdf..51141923cd8 100644 --- a/tests/rustdoc/private-fields-tuple-struct.rs +++ b/tests/rustdoc/private-fields-tuple-struct.rs @@ -1,15 +1,15 @@ // This test checks the diplay of "/* private fields */" sentence in tuple structs. #![crate_name = "foo"] -// @has 'foo/struct.A.html' '//*[@class="rust item-decl"]/code' 'pub struct A(pub u8, _);' +//@ has 'foo/struct.A.html' '//*[@class="rust item-decl"]/code' 'pub struct A(pub u8, _);' pub struct A(pub u8, u8); -// @has 'foo/struct.B.html' '//*[@class="rust item-decl"]/code' 'pub struct B(_, pub u8);' +//@ has 'foo/struct.B.html' '//*[@class="rust item-decl"]/code' 'pub struct B(_, pub u8);' pub struct B(u8, pub u8); -// @has 'foo/struct.C.html' '//*[@class="rust item-decl"]/code' 'pub struct C(_, pub u8, _);' +//@ has 'foo/struct.C.html' '//*[@class="rust item-decl"]/code' 'pub struct C(_, pub u8, _);' pub struct C(u8, pub u8, u8); -// @has 'foo/struct.D.html' '//*[@class="rust item-decl"]/code' 'pub struct D(pub u8, _, pub u8);' +//@ has 'foo/struct.D.html' '//*[@class="rust item-decl"]/code' 'pub struct D(pub u8, _, pub u8);' pub struct D(pub u8, u8, pub u8); -// @has 'foo/struct.E.html' '//*[@class="rust item-decl"]/code' 'pub struct E(/* private fields */);' +//@ has 'foo/struct.E.html' '//*[@class="rust item-decl"]/code' 'pub struct E(/* private fields */);' pub struct E(u8); -// @has 'foo/struct.F.html' '//*[@class="rust item-decl"]/code' 'pub struct F(/* private fields */);' +//@ has 'foo/struct.F.html' '//*[@class="rust item-decl"]/code' 'pub struct F(/* private fields */);' pub struct F(u8, u8); diff --git a/tests/rustdoc/private-non-local-fields-2.rs b/tests/rustdoc/private-non-local-fields-2.rs index 615b957f697..f2d3530c088 100644 --- a/tests/rustdoc/private-non-local-fields-2.rs +++ b/tests/rustdoc/private-non-local-fields-2.rs @@ -7,5 +7,5 @@ use std::collections::BTreeMap; -// @has 'foo/type.FooBar.html' '//*[@class="rust item-decl"]/code' 'struct FooBar { /* private fields */ }' +//@ has 'foo/type.FooBar.html' '//*[@class="rust item-decl"]/code' 'struct FooBar { /* private fields */ }' pub type FooBar = BTreeMap; diff --git a/tests/rustdoc/private-non-local-fields.rs b/tests/rustdoc/private-non-local-fields.rs index 7922ce074dd..aa7f01a58c6 100644 --- a/tests/rustdoc/private-non-local-fields.rs +++ b/tests/rustdoc/private-non-local-fields.rs @@ -5,5 +5,5 @@ use std::collections::BTreeMap; -// @has 'foo/type.FooBar.html' '//*[@class="rust item-decl"]/code' 'struct FooBar { /* private fields */ }' +//@ has 'foo/type.FooBar.html' '//*[@class="rust item-decl"]/code' 'struct FooBar { /* private fields */ }' pub type FooBar = BTreeMap; diff --git a/tests/rustdoc/private-type-alias.rs b/tests/rustdoc/private-type-alias.rs index ec7385404f0..5b5f52728a9 100644 --- a/tests/rustdoc/private-type-alias.rs +++ b/tests/rustdoc/private-type-alias.rs @@ -1,12 +1,12 @@ type MyResultPriv = Result; pub type MyResultPub = Result; -// @has private_type_alias/fn.get_result_priv.html '//pre' 'Result' +//@ has private_type_alias/fn.get_result_priv.html '//pre' 'Result' pub fn get_result_priv() -> MyResultPriv { panic!(); } -// @has private_type_alias/fn.get_result_pub.html '//pre' 'MyResultPub' +//@ has private_type_alias/fn.get_result_pub.html '//pre' 'MyResultPub' pub fn get_result_pub() -> MyResultPub { panic!(); } @@ -18,14 +18,14 @@ type PrivRecursive1 = PrivRecursive3; // PrivRecursive1 is expanded twice and stops at u8 // PrivRecursive2 is expanded once and stops at public type alias PubRecursive -// @has private_type_alias/fn.get_result_recursive.html '//pre' '(u8, PubRecursive)' +//@ has private_type_alias/fn.get_result_recursive.html '//pre' '(u8, PubRecursive)' pub fn get_result_recursive() -> (PrivRecursive1, PrivRecursive2) { panic!(); } type MyLifetimePriv<'a> = &'a isize; -// @has private_type_alias/fn.get_lifetime_priv.html '//pre' "&'static isize" +//@ has private_type_alias/fn.get_lifetime_priv.html '//pre' "&'static isize" pub fn get_lifetime_priv() -> MyLifetimePriv<'static> { panic!(); } diff --git a/tests/rustdoc/private-use-decl-macro-47038.rs b/tests/rustdoc/private-use-decl-macro-47038.rs index 8944bdd42b4..b72fca06d3b 100644 --- a/tests/rustdoc/private-use-decl-macro-47038.rs +++ b/tests/rustdoc/private-use-decl-macro-47038.rs @@ -6,7 +6,7 @@ use std::vec; -// @has 'foo/index.html' -// @!has - '//*[@id="macros"]' 'Macros' -// @!has - '//a/@href' 'macro.vec.html' -// @!has 'foo/macro.vec.html' +//@ has 'foo/index.html' +//@ !has - '//*[@id="macros"]' 'Macros' +//@ !has - '//a/@href' 'macro.vec.html' +//@ !has 'foo/macro.vec.html' diff --git a/tests/rustdoc/proc-macro.rs b/tests/rustdoc/proc-macro.rs index 57bf228052c..a821f68ab93 100644 --- a/tests/rustdoc/proc-macro.rs +++ b/tests/rustdoc/proc-macro.rs @@ -5,8 +5,8 @@ #![crate_type="proc-macro"] #![crate_name="some_macros"] -// @has some_macros/index.html -// @has - '//a/[@href="attr.some_proc_attr.html"]' 'some_proc_attr' +//@ has some_macros/index.html +//@ has - '//a/[@href="attr.some_proc_attr.html"]' 'some_proc_attr' //! include a link to [some_proc_macro!] to make sure it works. @@ -14,59 +14,59 @@ extern crate proc_macro; use proc_macro::TokenStream; -// @has some_macros/index.html -// @has - '//h2' 'Macros' -// @has - '//h2' 'Attribute Macros' -// @has - '//h2' 'Derive Macros' -// @!has - '//h2' 'Functions' +//@ has some_macros/index.html +//@ has - '//h2' 'Macros' +//@ has - '//h2' 'Attribute Macros' +//@ has - '//h2' 'Derive Macros' +//@ !has - '//h2' 'Functions' -// @has some_macros/all.html -// @has - '//a[@href="macro.some_proc_macro.html"]' 'some_proc_macro' -// @has - '//a[@href="attr.some_proc_attr.html"]' 'some_proc_attr' -// @has - '//a[@href="derive.SomeDerive.html"]' 'SomeDerive' -// @!has - '//a/@href' 'fn.some_proc_macro.html' -// @!has - '//a/@href' 'fn.some_proc_attr.html' -// @!has - '//a/@href' 'fn.some_derive.html' +//@ has some_macros/all.html +//@ has - '//a[@href="macro.some_proc_macro.html"]' 'some_proc_macro' +//@ has - '//a[@href="attr.some_proc_attr.html"]' 'some_proc_attr' +//@ has - '//a[@href="derive.SomeDerive.html"]' 'SomeDerive' +//@ !has - '//a/@href' 'fn.some_proc_macro.html' +//@ !has - '//a/@href' 'fn.some_proc_attr.html' +//@ !has - '//a/@href' 'fn.some_derive.html' -// @has some_macros/index.html '//a/@href' 'macro.some_proc_macro.html' -// @!has - '//a/@href' 'fn.some_proc_macro.html' -// @has some_macros/macro.some_proc_macro.html -// @!has some_macros/fn.some_proc_macro.html +//@ has some_macros/index.html '//a/@href' 'macro.some_proc_macro.html' +//@ !has - '//a/@href' 'fn.some_proc_macro.html' +//@ has some_macros/macro.some_proc_macro.html +//@ !has some_macros/fn.some_proc_macro.html /// a proc-macro that swallows its input and does nothing. #[proc_macro] pub fn some_proc_macro(_input: TokenStream) -> TokenStream { TokenStream::new() } -// @has some_macros/index.html '//a/@href' 'attr.some_proc_attr.html' -// @!has - '//a/@href' 'fn.some_proc_attr.html' -// @has some_macros/attr.some_proc_attr.html -// @!has some_macros/fn.some_proc_attr.html +//@ has some_macros/index.html '//a/@href' 'attr.some_proc_attr.html' +//@ !has - '//a/@href' 'fn.some_proc_attr.html' +//@ has some_macros/attr.some_proc_attr.html +//@ !has some_macros/fn.some_proc_attr.html /// a proc-macro attribute that passes its item through verbatim. #[proc_macro_attribute] pub fn some_proc_attr(_attr: TokenStream, item: TokenStream) -> TokenStream { item } -// @has some_macros/index.html '//a/@href' 'derive.SomeDerive.html' -// @!has - '//a/@href' 'fn.some_derive.html' -// @has some_macros/derive.SomeDerive.html -// @!has some_macros/fn.some_derive.html +//@ has some_macros/index.html '//a/@href' 'derive.SomeDerive.html' +//@ !has - '//a/@href' 'fn.some_derive.html' +//@ has some_macros/derive.SomeDerive.html +//@ !has some_macros/fn.some_derive.html /// a derive attribute that adds nothing to its input. #[proc_macro_derive(SomeDerive)] pub fn some_derive(_item: TokenStream) -> TokenStream { TokenStream::new() } -// @has some_macros/foo/index.html +//@ has some_macros/foo/index.html mod foo { - // @has - '//code' 'pub use some_proc_macro;' - // @has - '//a/@href' '../macro.some_proc_macro.html' + //@ has - '//code' 'pub use some_proc_macro;' + //@ has - '//a/@href' '../macro.some_proc_macro.html' pub use some_proc_macro; - // @has - '//code' 'pub use some_proc_attr;' - // @has - '//a/@href' '../attr.some_proc_attr.html' + //@ has - '//code' 'pub use some_proc_attr;' + //@ has - '//a/@href' '../attr.some_proc_attr.html' pub use some_proc_attr; - // @has - '//code' 'pub use some_derive;' - // @has - '//a/@href' '../derive.SomeDerive.html' + //@ has - '//code' 'pub use some_derive;' + //@ has - '//a/@href' '../derive.SomeDerive.html' pub use some_derive; } diff --git a/tests/rustdoc/pub-extern-crate.rs b/tests/rustdoc/pub-extern-crate.rs index c5be51f35ac..05f70301e33 100644 --- a/tests/rustdoc/pub-extern-crate.rs +++ b/tests/rustdoc/pub-extern-crate.rs @@ -1,9 +1,9 @@ //@ aux-build:pub-extern-crate.rs -// @has pub_extern_crate/index.html -// @!has - '//code' 'pub extern crate inner' -// @has - '//a/@href' 'inner/index.html' -// @has pub_extern_crate/inner/index.html -// @has pub_extern_crate/inner/struct.SomeStruct.html +//@ has pub_extern_crate/index.html +//@ !has - '//code' 'pub extern crate inner' +//@ has - '//a/@href' 'inner/index.html' +//@ has pub_extern_crate/inner/index.html +//@ has pub_extern_crate/inner/struct.SomeStruct.html #[doc(inline)] pub extern crate inner; diff --git a/tests/rustdoc/pub-method.rs b/tests/rustdoc/pub-method.rs index 2a77aa75352..a759967fae5 100644 --- a/tests/rustdoc/pub-method.rs +++ b/tests/rustdoc/pub-method.rs @@ -2,16 +2,16 @@ #![crate_name = "foo"] -// @has foo/fn.bar.html -// @has - '//pre[@class="rust item-decl"]' 'pub fn bar() -> ' +//@ has foo/fn.bar.html +//@ has - '//pre[@class="rust item-decl"]' 'pub fn bar() -> ' /// foo pub fn bar() -> usize { 2 } -// @has foo/struct.Foo.html -// @has - '//*[@class="method"]' 'pub fn new()' -// @has - '//*[@class="method"]' 'fn not_pub()' +//@ has foo/struct.Foo.html +//@ has - '//*[@class="method"]' 'pub fn new()' +//@ has - '//*[@class="method"]' 'fn not_pub()' pub struct Foo(usize); impl Foo { diff --git a/tests/rustdoc/pub-reexport-of-pub-reexport-46506.rs b/tests/rustdoc/pub-reexport-of-pub-reexport-46506.rs index ae0aead244b..f9569902927 100644 --- a/tests/rustdoc/pub-reexport-of-pub-reexport-46506.rs +++ b/tests/rustdoc/pub-reexport-of-pub-reexport-46506.rs @@ -3,11 +3,11 @@ #![crate_name = "foo"] -// @has 'foo/associations/index.html' -// @count - '//*[@id="main-content"]/*[@class="section-header"]' 1 -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Traits' -// @has - '//*[@id="main-content"]//a[@href="trait.GroupedBy.html"]' 'GroupedBy' -// @has 'foo/associations/trait.GroupedBy.html' +//@ has 'foo/associations/index.html' +//@ count - '//*[@id="main-content"]/*[@class="section-header"]' 1 +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Traits' +//@ has - '//*[@id="main-content"]//a[@href="trait.GroupedBy.html"]' 'GroupedBy' +//@ has 'foo/associations/trait.GroupedBy.html' pub mod associations { mod belongs_to { pub trait GroupedBy {} @@ -15,10 +15,10 @@ pub mod associations { pub use self::belongs_to::GroupedBy; } -// @has 'foo/prelude/index.html' -// @count - '//*[@id="main-content"]/*[@class="section-header"]' 1 -// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Re-exports' -// @has - '//*[@id="main-content"]//*[@id="reexport.GroupedBy"]' 'pub use associations::GroupedBy;' +//@ has 'foo/prelude/index.html' +//@ count - '//*[@id="main-content"]/*[@class="section-header"]' 1 +//@ has - '//*[@id="main-content"]/*[@class="section-header"]' 'Re-exports' +//@ has - '//*[@id="main-content"]//*[@id="reexport.GroupedBy"]' 'pub use associations::GroupedBy;' pub mod prelude { pub use associations::GroupedBy; } diff --git a/tests/rustdoc/pub-use-extern-macros.rs b/tests/rustdoc/pub-use-extern-macros.rs index d3d667297fb..2316e620343 100644 --- a/tests/rustdoc/pub-use-extern-macros.rs +++ b/tests/rustdoc/pub-use-extern-macros.rs @@ -2,16 +2,16 @@ extern crate macros; -// @has pub_use_extern_macros/macro.bar.html -// @!has pub_use_extern_macros/index.html '//code' 'pub use macros::bar;' +//@ has pub_use_extern_macros/macro.bar.html +//@ !has pub_use_extern_macros/index.html '//code' 'pub use macros::bar;' pub use macros::bar; -// @has pub_use_extern_macros/macro.baz.html -// @!has pub_use_extern_macros/index.html '//code' 'pub use macros::baz;' +//@ has pub_use_extern_macros/macro.baz.html +//@ !has pub_use_extern_macros/index.html '//code' 'pub use macros::baz;' #[doc(inline)] pub use macros::baz; -// @!has pub_use_extern_macros/macro.quux.html -// @!has pub_use_extern_macros/index.html '//code' 'pub use macros::quux;' +//@ !has pub_use_extern_macros/macro.quux.html +//@ !has pub_use_extern_macros/index.html '//code' 'pub use macros::quux;' #[doc(hidden)] pub use macros::quux; diff --git a/tests/rustdoc/pub-use-root-path-95873.rs b/tests/rustdoc/pub-use-root-path-95873.rs index 5a817fb3409..e3d5ee6e315 100644 --- a/tests/rustdoc/pub-use-root-path-95873.rs +++ b/tests/rustdoc/pub-use-root-path-95873.rs @@ -1,5 +1,5 @@ // https://github.com/rust-lang/rust/issues/95873 #![crate_name = "foo"] -// @has foo/index.html "//*[@class='item-name']" "pub use ::std as x;" +//@ has foo/index.html "//*[@class='item-name']" "pub use ::std as x;" pub use ::std as x; diff --git a/tests/rustdoc/public-impl-mention-private-generic-46380-2.rs b/tests/rustdoc/public-impl-mention-private-generic-46380-2.rs index 96ebd888eb5..0445ae75e85 100644 --- a/tests/rustdoc/public-impl-mention-private-generic-46380-2.rs +++ b/tests/rustdoc/public-impl-mention-private-generic-46380-2.rs @@ -3,10 +3,10 @@ pub trait PublicTrait {} -// @has foo/struct.PublicStruct.html +//@ has foo/struct.PublicStruct.html pub struct PublicStruct; -// @!has - '//*[@class="impl"]' 'impl PublicTrait for PublicStruct' +//@ !has - '//*[@class="impl"]' 'impl PublicTrait for PublicStruct' impl PublicTrait for PublicStruct {} struct PrivateStruct; diff --git a/tests/rustdoc/range-arg-pattern.rs b/tests/rustdoc/range-arg-pattern.rs index d0d9111bb40..e5de6ba464b 100644 --- a/tests/rustdoc/range-arg-pattern.rs +++ b/tests/rustdoc/range-arg-pattern.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -// @has foo/fn.f.html -// @has - '//pre[@class="rust item-decl"]' 'pub fn f(_: u8)' +//@ has foo/fn.f.html +//@ has - '//pre[@class="rust item-decl"]' 'pub fn f(_: u8)' pub fn f(0u8..=255: u8) {} diff --git a/tests/rustdoc/raw-ident-eliminate-r-hashtag.rs b/tests/rustdoc/raw-ident-eliminate-r-hashtag.rs index 7dbe63854f3..d9b88627ae5 100644 --- a/tests/rustdoc/raw-ident-eliminate-r-hashtag.rs +++ b/tests/rustdoc/raw-ident-eliminate-r-hashtag.rs @@ -1,7 +1,7 @@ #![crate_type="lib"] pub mod internal { - // @has 'raw_ident_eliminate_r_hashtag/internal/struct.mod.html' + //@ has 'raw_ident_eliminate_r_hashtag/internal/struct.mod.html' #[allow(non_camel_case_types)] pub struct r#mod; @@ -9,13 +9,13 @@ pub mod internal { /// /// [name]: mod /// [other name]: crate::internal::mod - // @has 'raw_ident_eliminate_r_hashtag/internal/struct.B.html' '//*a[@href="struct.mod.html"]' 'name' - // @has 'raw_ident_eliminate_r_hashtag/internal/struct.B.html' '//*a[@href="struct.mod.html"]' 'other name' + //@ has 'raw_ident_eliminate_r_hashtag/internal/struct.B.html' '//*a[@href="struct.mod.html"]' 'name' + //@ has 'raw_ident_eliminate_r_hashtag/internal/struct.B.html' '//*a[@href="struct.mod.html"]' 'other name' pub struct B; } /// See [name]. /// /// [name]: internal::mod -// @has 'raw_ident_eliminate_r_hashtag/struct.A.html' '//*a[@href="internal/struct.mod.html"]' 'name' +//@ has 'raw_ident_eliminate_r_hashtag/struct.A.html' '//*a[@href="internal/struct.mod.html"]' 'name' pub struct A; diff --git a/tests/rustdoc/read-more-unneeded.rs b/tests/rustdoc/read-more-unneeded.rs index 0303e444261..783ebe78200 100644 --- a/tests/rustdoc/read-more-unneeded.rs +++ b/tests/rustdoc/read-more-unneeded.rs @@ -23,12 +23,12 @@ pub trait MyFrom { pub struct NonZero; -// @has 'foo/struct.NonZero.html' +//@ has 'foo/struct.NonZero.html' impl MyFrom for NonZero { - // @matches - '//*[@class="docblock"]' '^Hello Read more$' + //@ matches - '//*[@class="docblock"]' '^Hello Read more$' fn try_from1() {} - // @matches - '//*[@class="docblock"]' '^a\sb\sc$' + //@ matches - '//*[@class="docblock"]' '^a\sb\sc$' fn try_from2() {} - // @matches - '//*[@class="docblock"]' '^a Read more$' + //@ matches - '//*[@class="docblock"]' '^a Read more$' fn try_from3() {} } diff --git a/tests/rustdoc/redirect-const.rs b/tests/rustdoc/redirect-const.rs index 453da8387ea..e636a915f30 100644 --- a/tests/rustdoc/redirect-const.rs +++ b/tests/rustdoc/redirect-const.rs @@ -4,10 +4,10 @@ pub use hidden::STATIC_FOO; pub use hidden::CONST_FOO; mod hidden { - // @has foo/hidden/static.STATIC_FOO.html - // @has - '//p/a' '../../foo/static.STATIC_FOO.html' + //@ has foo/hidden/static.STATIC_FOO.html + //@ has - '//p/a' '../../foo/static.STATIC_FOO.html' pub static STATIC_FOO: u64 = 0; - // @has foo/hidden/constant.CONST_FOO.html - // @has - '//p/a' '../../foo/constant.CONST_FOO.html' + //@ has foo/hidden/constant.CONST_FOO.html + //@ has - '//p/a' '../../foo/constant.CONST_FOO.html' pub const CONST_FOO: u64 = 0; } diff --git a/tests/rustdoc/redirect-map-empty.rs b/tests/rustdoc/redirect-map-empty.rs index 12e500e785e..7d215fc230e 100644 --- a/tests/rustdoc/redirect-map-empty.rs +++ b/tests/rustdoc/redirect-map-empty.rs @@ -2,5 +2,5 @@ #![crate_name = "foo"] -// @!has foo/redirect-map.json +//@ !has foo/redirect-map.json pub struct Foo; diff --git a/tests/rustdoc/redirect-map.rs b/tests/rustdoc/redirect-map.rs index 3ad25298494..0207ba98fdb 100644 --- a/tests/rustdoc/redirect-map.rs +++ b/tests/rustdoc/redirect-map.rs @@ -2,9 +2,9 @@ #![crate_name = "foo"] -// @!has foo/private/struct.Quz.html -// @!has foo/hidden/struct.Bar.html -// @has foo/redirect-map.json +//@ !has foo/private/struct.Quz.html +//@ !has foo/hidden/struct.Bar.html +//@ has foo/redirect-map.json pub use private::Quz; pub use hidden::Bar; diff --git a/tests/rustdoc/redirect-rename.rs b/tests/rustdoc/redirect-rename.rs index 504c0687c8d..724dd4978ca 100644 --- a/tests/rustdoc/redirect-rename.rs +++ b/tests/rustdoc/redirect-rename.rs @@ -1,34 +1,34 @@ #![crate_name = "foo"] mod hidden { - // @has foo/hidden/struct.Foo.html - // @has - '//p/a' '../../foo/struct.FooBar.html' + //@ has foo/hidden/struct.Foo.html + //@ has - '//p/a' '../../foo/struct.FooBar.html' pub struct Foo {} pub union U { a: usize } pub enum Empty {} pub const C: usize = 1; pub static S: usize = 1; - // @has foo/hidden/bar/index.html - // @has - '//p/a' '../../foo/baz/index.html' + //@ has foo/hidden/bar/index.html + //@ has - '//p/a' '../../foo/baz/index.html' pub mod bar { - // @has foo/hidden/bar/struct.Thing.html - // @has - '//p/a' '../../foo/baz/struct.Thing.html' + //@ has foo/hidden/bar/struct.Thing.html + //@ has - '//p/a' '../../foo/baz/struct.Thing.html' pub struct Thing {} } } -// @has foo/struct.FooBar.html +//@ has foo/struct.FooBar.html pub use hidden::Foo as FooBar; -// @has foo/union.FooU.html +//@ has foo/union.FooU.html pub use hidden::U as FooU; -// @has foo/enum.FooEmpty.html +//@ has foo/enum.FooEmpty.html pub use hidden::Empty as FooEmpty; -// @has foo/constant.FooC.html +//@ has foo/constant.FooC.html pub use hidden::C as FooC; -// @has foo/static.FooS.html +//@ has foo/static.FooS.html pub use hidden::S as FooS; -// @has foo/baz/index.html -// @has foo/baz/struct.Thing.html +//@ has foo/baz/index.html +//@ has foo/baz/struct.Thing.html pub use hidden::bar as baz; diff --git a/tests/rustdoc/redirect.rs b/tests/rustdoc/redirect.rs index dc3a06b94d0..e52d3e5e83e 100644 --- a/tests/rustdoc/redirect.rs +++ b/tests/rustdoc/redirect.rs @@ -6,25 +6,25 @@ extern crate reexp_stripped; pub trait Foo {} -// @has redirect/index.html -// @has - '//code' 'pub use reexp_stripped::Bar' -// @has - '//code/a' 'Bar' -// @has - '//a[@href="../reexp_stripped/hidden/struct.Bar.html"]' 'Bar' +//@ has redirect/index.html +//@ has - '//code' 'pub use reexp_stripped::Bar' +//@ has - '//code/a' 'Bar' +//@ has - '//a[@href="../reexp_stripped/hidden/struct.Bar.html"]' 'Bar' // FIXME: Should be `@!has`: https://github.com/rust-lang/rust/issues/111249 -// @has reexp_stripped/hidden/struct.Bar.html -// @matchesraw - '' -// @has 'reexp_stripped/struct.Bar.html' -// @has - '//a[@href="struct.Bar.html"]' 'Bar' +//@ has reexp_stripped/hidden/struct.Bar.html +//@ matchesraw - '' +//@ has 'reexp_stripped/struct.Bar.html' +//@ has - '//a[@href="struct.Bar.html"]' 'Bar' #[doc(no_inline)] pub use reexp_stripped::Bar; impl Foo for Bar {} -// @has redirect/index.html -// @has - '//code' 'pub use reexp_stripped::Quz' -// @has - '//code/a' 'Quz' -// @has reexp_stripped/private/struct.Quz.html -// @has - '//p/a' '../../reexp_stripped/struct.Quz.html' -// @has 'reexp_stripped/struct.Quz.html' +//@ has redirect/index.html +//@ has - '//code' 'pub use reexp_stripped::Quz' +//@ has - '//code/a' 'Quz' +//@ has reexp_stripped/private/struct.Quz.html +//@ has - '//p/a' '../../reexp_stripped/struct.Quz.html' +//@ has 'reexp_stripped/struct.Quz.html' #[doc(no_inline)] pub use reexp_stripped::Quz; impl Foo for Quz {} @@ -34,9 +34,9 @@ mod private_no_inline { impl ::Foo for Qux {} } -// @has redirect/index.html -// @has - '//code' 'pub use private_no_inline::Qux' -// @!has - '//a' 'Qux' -// @!has redirect/struct.Qux.html +//@ has redirect/index.html +//@ has - '//code' 'pub use private_no_inline::Qux' +//@ !has - '//a' 'Qux' +//@ !has redirect/struct.Qux.html #[doc(no_inline)] pub use private_no_inline::Qux; diff --git a/tests/rustdoc/reexport-attr-merge.rs b/tests/rustdoc/reexport-attr-merge.rs index 6cc054e7a8b..e4a406c3845 100644 --- a/tests/rustdoc/reexport-attr-merge.rs +++ b/tests/rustdoc/reexport-attr-merge.rs @@ -5,7 +5,7 @@ #![crate_name = "foo"] #![feature(doc_cfg)] -// @has 'foo/index.html' +//@ has 'foo/index.html' #[doc(hidden, cfg(feature = "foo"))] pub struct Foo; @@ -18,16 +18,16 @@ pub use Foo1 as Foo2; // First we ensure that only the reexport `Bar2` and the inlined struct `Bar` // are inlined. -// @count - '//a[@class="struct"]' 2 +//@ count - '//a[@class="struct"]' 2 // Then we check that `cfg` is displayed for base item, but not for intermediate re-exports. -// @has - '//*[@class="stab portability"]' 'foo' -// @!has - '//*[@class="stab portability"]' 'bar' +//@ has - '//*[@class="stab portability"]' 'foo' +//@ !has - '//*[@class="stab portability"]' 'bar' // And finally we check that the only element displayed is `Bar`. -// @has - '//a[@class="struct"]' 'Bar' +//@ has - '//a[@class="struct"]' 'Bar' #[doc(inline)] pub use Foo2 as Bar; // This one should appear but `Bar2` won't be linked because there is no // `#[doc(inline)]`. -// @has - '//*[@id="reexport.Bar2"]' 'pub use Foo2 as Bar2;' +//@ has - '//*[@id="reexport.Bar2"]' 'pub use Foo2 as Bar2;' pub use Foo2 as Bar2; diff --git a/tests/rustdoc/reexport-cfg.rs b/tests/rustdoc/reexport-cfg.rs index a6179fad873..7270da3d678 100644 --- a/tests/rustdoc/reexport-cfg.rs +++ b/tests/rustdoc/reexport-cfg.rs @@ -12,19 +12,19 @@ mod foo { pub struct Bar2; } -// @has 'foo/index.html' -// @has - '//*[@class="item-name"]' 'BabarNon-lie' +//@ has 'foo/index.html' +//@ has - '//*[@class="item-name"]' 'BabarNon-lie' #[cfg(not(feature = "lie"))] pub use crate::foo::Bar as Babar; -// @has - '//*[@class="item-name"]' 'Babar2Non-cake' +//@ has - '//*[@class="item-name"]' 'Babar2Non-cake' #[doc(cfg(not(feature = "cake")))] pub use crate::foo::Bar2 as Babar2; -// @has - '//*[@class="item-table"]/li' 'pub use crate::Babar as Elephant;Non-robot' +//@ has - '//*[@class="item-table"]/li' 'pub use crate::Babar as Elephant;Non-robot' #[cfg(not(feature = "robot"))] pub use crate::Babar as Elephant; -// @has - '//*[@class="item-table"]/li' 'pub use crate::Babar2 as Elephant2;Non-cat' +//@ has - '//*[@class="item-table"]/li' 'pub use crate::Babar2 as Elephant2;Non-cat' #[doc(cfg(not(feature = "cat")))] pub use crate::Babar2 as Elephant2; diff --git a/tests/rustdoc/reexport-check.rs b/tests/rustdoc/reexport-check.rs index 92729b82ae2..0f4e203d1d3 100644 --- a/tests/rustdoc/reexport-check.rs +++ b/tests/rustdoc/reexport-check.rs @@ -3,18 +3,18 @@ extern crate reexport_check; -// @!has 'foo/index.html' '//code' 'pub use self::i32;' -// @has 'foo/i32/index.html' +//@ !has 'foo/index.html' '//code' 'pub use self::i32;' +//@ has 'foo/i32/index.html' #[allow(deprecated, deprecated_in_future)] pub use std::i32; -// @!has 'foo/index.html' '//code' 'pub use self::string::String;' -// @has 'foo/index.html' '//div[@class="item-name"]' 'String' +//@ !has 'foo/index.html' '//code' 'pub use self::string::String;' +//@ has 'foo/index.html' '//div[@class="item-name"]' 'String' pub use std::string::String; // i32 is deprecated, String is not -// @count 'foo/index.html' '//span[@class="stab deprecated"]' 1 +//@ count 'foo/index.html' '//span[@class="stab deprecated"]' 1 -// @has 'foo/index.html' '//div[@class="desc docblock-short"]' 'Docs in original' +//@ has 'foo/index.html' '//div[@class="desc docblock-short"]' 'Docs in original' // this is a no-op, but shows what happens if there's an attribute that isn't a doc-comment #[doc(inline)] pub use reexport_check::S; diff --git a/tests/rustdoc/reexport-dep-foreign-fn.rs b/tests/rustdoc/reexport-dep-foreign-fn.rs index 1da3d8044b9..1b63fcff017 100644 --- a/tests/rustdoc/reexport-dep-foreign-fn.rs +++ b/tests/rustdoc/reexport-dep-foreign-fn.rs @@ -7,6 +7,6 @@ extern crate all_item_types; -// @has 'foo/fn.foo_ffn.html' -// @has - '//*[@class="rust item-decl"]//code' 'pub unsafe extern "C" fn foo_ffn()' +//@ has 'foo/fn.foo_ffn.html' +//@ has - '//*[@class="rust item-decl"]//code' 'pub unsafe extern "C" fn foo_ffn()' pub use all_item_types::foo_ffn; diff --git a/tests/rustdoc/reexport-doc-hidden-inside-private.rs b/tests/rustdoc/reexport-doc-hidden-inside-private.rs index e9d243d8abf..fac928fc2a3 100644 --- a/tests/rustdoc/reexport-doc-hidden-inside-private.rs +++ b/tests/rustdoc/reexport-doc-hidden-inside-private.rs @@ -8,9 +8,9 @@ mod private_module { pub struct Public; } -// @has 'foo/index.html' -// @has - '//*[@id="reexport.Foo"]/code' 'pub use crate::private_module::Public as Foo;' +//@ has 'foo/index.html' +//@ has - '//*[@id="reexport.Foo"]/code' 'pub use crate::private_module::Public as Foo;' pub use crate::private_module::Public as Foo; // Glob re-exports with no visible items should not be displayed. -// @count - '//*[@class="item-table"]/li' 1 +//@ count - '//*[@class="item-table"]/li' 1 pub use crate::private_module::*; diff --git a/tests/rustdoc/reexport-doc-hidden.rs b/tests/rustdoc/reexport-doc-hidden.rs index d9ed954868e..b912362f298 100644 --- a/tests/rustdoc/reexport-doc-hidden.rs +++ b/tests/rustdoc/reexport-doc-hidden.rs @@ -7,11 +7,11 @@ #[doc(hidden)] pub type Type = u32; -// @has 'foo/index.html' -// @has - '//*[@id="reexport.Type2"]/code' 'pub use crate::Type as Type2;' +//@ has 'foo/index.html' +//@ has - '//*[@id="reexport.Type2"]/code' 'pub use crate::Type as Type2;' pub use crate::Type as Type2; -// @count - '//*[@id="reexport.Type3"]' 0 +//@ count - '//*[@id="reexport.Type3"]' 0 #[doc(hidden)] pub use crate::Type as Type3; @@ -21,5 +21,5 @@ macro_rules! foo { () => {}; } -// @has - '//*[@id="reexport.Macro"]/code' 'pub use crate::foo as Macro;' +//@ has - '//*[@id="reexport.Macro"]/code' 'pub use crate::foo as Macro;' pub use crate::foo as Macro; diff --git a/tests/rustdoc/reexport-doc.rs b/tests/rustdoc/reexport-doc.rs index cb1a398b1c3..0c20de41231 100644 --- a/tests/rustdoc/reexport-doc.rs +++ b/tests/rustdoc/reexport-doc.rs @@ -2,7 +2,7 @@ extern crate reexport_doc_aux as dep; -// @has 'reexport_doc/struct.Foo.html' -// @count - '//p' 'These are the docs for Foo.' 1 +//@ has 'reexport_doc/struct.Foo.html' +//@ count - '//p' 'These are the docs for Foo.' 1 /// These are the docs for Foo. pub use dep::Foo; diff --git a/tests/rustdoc/reexport-hidden-macro.rs b/tests/rustdoc/reexport-hidden-macro.rs index 47a21e39462..9b83bca3906 100644 --- a/tests/rustdoc/reexport-hidden-macro.rs +++ b/tests/rustdoc/reexport-hidden-macro.rs @@ -3,12 +3,12 @@ #![crate_name = "foo"] -// @has 'foo/index.html' -// @has - '//*[@id="main-content"]//a[@href="macro.Macro2.html"]' 'Macro2' -// @has - '//*[@id="reexport.Macro"]/code' 'pub use crate::foo as Macro;' +//@ has 'foo/index.html' +//@ has - '//*[@id="main-content"]//a[@href="macro.Macro2.html"]' 'Macro2' +//@ has - '//*[@id="reexport.Macro"]/code' 'pub use crate::foo as Macro;' -// @has 'foo/macro.Macro2.html' -// @has - '//*[@class="docblock"]' 'Displayed' +//@ has 'foo/macro.Macro2.html' +//@ has - '//*[@class="docblock"]' 'Displayed' #[macro_export] #[doc(hidden)] diff --git a/tests/rustdoc/reexport-macro.rs b/tests/rustdoc/reexport-macro.rs index c4dec703aed..7e041eb90ba 100644 --- a/tests/rustdoc/reexport-macro.rs +++ b/tests/rustdoc/reexport-macro.rs @@ -3,9 +3,9 @@ #![crate_name = "foo"] -// @has 'foo/macro.foo.html' -// @!has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'x y' -// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'y' +//@ has 'foo/macro.foo.html' +//@ !has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'x y' +//@ has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'y' #[macro_use] mod my_module { /// y @@ -15,8 +15,8 @@ mod my_module { } } -// @has 'foo/another_mod/macro.bar.html' -// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'x y' +//@ has 'foo/another_mod/macro.bar.html' +//@ has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'x y' pub mod another_mod { /// x pub use crate::foo as bar; diff --git a/tests/rustdoc/reexport-of-doc-hidden.rs b/tests/rustdoc/reexport-of-doc-hidden.rs index b733716c22a..21511bc2aea 100644 --- a/tests/rustdoc/reexport-of-doc-hidden.rs +++ b/tests/rustdoc/reexport-of-doc-hidden.rs @@ -11,32 +11,32 @@ macro_rules! foo { () => {}; } -// @has 'foo/index.html' -// @has - '//*[@id="reexport.Macro"]/code' 'pub use crate::foo as Macro;' +//@ has 'foo/index.html' +//@ has - '//*[@id="reexport.Macro"]/code' 'pub use crate::foo as Macro;' pub use crate::foo as Macro; -// @has - '//*[@id="reexport.Macro2"]/code' 'pub use crate::foo as Macro2;' +//@ has - '//*[@id="reexport.Macro2"]/code' 'pub use crate::foo as Macro2;' pub use crate::foo as Macro2; -// @has - '//*[@id="reexport.Boo"]/code' 'pub use crate::Bar as Boo;' +//@ has - '//*[@id="reexport.Boo"]/code' 'pub use crate::Bar as Boo;' pub use crate::Bar as Boo; -// @has - '//*[@id="reexport.Boo2"]/code' 'pub use crate::Bar as Boo2;' +//@ has - '//*[@id="reexport.Boo2"]/code' 'pub use crate::Bar as Boo2;' pub use crate::Bar as Boo2; pub fn fofo() {} -// @has - '//*[@id="reexport.f1"]/code' 'pub use crate::fofo as f1;' +//@ has - '//*[@id="reexport.f1"]/code' 'pub use crate::fofo as f1;' pub use crate::fofo as f1; -// @has - '//*[@id="reexport.f2"]/code' 'pub use crate::fofo as f2;' +//@ has - '//*[@id="reexport.f2"]/code' 'pub use crate::fofo as f2;' pub use crate::fofo as f2; pub mod sub { - // @has 'foo/sub/index.html' - // @has - '//*[@id="reexport.Macro"]/code' 'pub use crate::foo as Macro;' + //@ has 'foo/sub/index.html' + //@ has - '//*[@id="reexport.Macro"]/code' 'pub use crate::foo as Macro;' pub use crate::foo as Macro; - // @has - '//*[@id="reexport.Macro2"]/code' 'pub use crate::foo as Macro2;' + //@ has - '//*[@id="reexport.Macro2"]/code' 'pub use crate::foo as Macro2;' pub use crate::foo as Macro2; - // @has - '//*[@id="reexport.f1"]/code' 'pub use crate::fofo as f1;' + //@ has - '//*[@id="reexport.f1"]/code' 'pub use crate::fofo as f1;' pub use crate::fofo as f1; - // @has - '//*[@id="reexport.f2"]/code' 'pub use crate::fofo as f2;' + //@ has - '//*[@id="reexport.f2"]/code' 'pub use crate::fofo as f2;' pub use crate::fofo as f2; } diff --git a/tests/rustdoc/reexport-stability-tags-deprecated-and-portability.rs b/tests/rustdoc/reexport-stability-tags-deprecated-and-portability.rs index c81c654a20e..f83f28f458e 100644 --- a/tests/rustdoc/reexport-stability-tags-deprecated-and-portability.rs +++ b/tests/rustdoc/reexport-stability-tags-deprecated-and-portability.rs @@ -15,34 +15,34 @@ pub mod tag { pub trait None {} } -// @has foo/mod1/index.html +//@ has foo/mod1/index.html pub mod mod1 { - // @has - '//code' 'pub use tag::Deprecated;' - // @has - '//span' 'Deprecated' - // @!has - '//span' 'sync' + //@ has - '//code' 'pub use tag::Deprecated;' + //@ has - '//span' 'Deprecated' + //@ !has - '//span' 'sync' pub use tag::Deprecated; } -// @has foo/mod2/index.html +//@ has foo/mod2/index.html pub mod mod2 { - // @has - '//code' 'pub use tag::Portability;' - // @!has - '//span' 'Deprecated' - // @!has - '//span' 'sync' + //@ has - '//code' 'pub use tag::Portability;' + //@ !has - '//span' 'Deprecated' + //@ !has - '//span' 'sync' pub use tag::Portability; } -// @has foo/mod3/index.html +//@ has foo/mod3/index.html pub mod mod3 { - // @has - '//code' 'pub use tag::Both;' - // @has - '//span' 'Deprecated' - // @!has - '//span' 'sync' + //@ has - '//code' 'pub use tag::Both;' + //@ has - '//span' 'Deprecated' + //@ !has - '//span' 'sync' pub use tag::Both; } -// @has foo/mod4/index.html +//@ has foo/mod4/index.html pub mod mod4 { - // @has - '//code' 'pub use tag::None;' - // @!has - '//span' 'Deprecated' - // @!has - '//span' 'sync' + //@ has - '//code' 'pub use tag::None;' + //@ !has - '//span' 'Deprecated' + //@ !has - '//span' 'sync' pub use tag::None; } diff --git a/tests/rustdoc/reexport-stability-tags-unstable-and-portability.rs b/tests/rustdoc/reexport-stability-tags-unstable-and-portability.rs index 423838e251b..adf3eed204a 100644 --- a/tests/rustdoc/reexport-stability-tags-unstable-and-portability.rs +++ b/tests/rustdoc/reexport-stability-tags-unstable-and-portability.rs @@ -20,42 +20,42 @@ pub mod tag { pub trait None {} } -// @has foo/mod1/index.html +//@ has foo/mod1/index.html #[stable(feature = "rust1", since = "1.0.0")] pub mod mod1 { - // @has - '//code' 'pub use tag::Unstable;' - // @has - '//span' 'Experimental' - // @!has - '//span' 'sync' + //@ has - '//code' 'pub use tag::Unstable;' + //@ has - '//span' 'Experimental' + //@ !has - '//span' 'sync' #[stable(feature = "rust1", since = "1.0.0")] pub use tag::Unstable; } -// @has foo/mod2/index.html +//@ has foo/mod2/index.html #[stable(feature = "rust1", since = "1.0.0")] pub mod mod2 { - // @has - '//code' 'pub use tag::Portability;' - // @!has - '//span' 'Experimental' - // @!has - '//span' 'sync' + //@ has - '//code' 'pub use tag::Portability;' + //@ !has - '//span' 'Experimental' + //@ !has - '//span' 'sync' #[stable(feature = "rust1", since = "1.0.0")] pub use tag::Portability; } -// @has foo/mod3/index.html +//@ has foo/mod3/index.html #[stable(feature = "rust1", since = "1.0.0")] pub mod mod3 { - // @has - '//code' 'pub use tag::Both;' - // @has - '//span' 'Experimental' - // @!has - '//span' 'sync' + //@ has - '//code' 'pub use tag::Both;' + //@ has - '//span' 'Experimental' + //@ !has - '//span' 'sync' #[stable(feature = "rust1", since = "1.0.0")] pub use tag::Both; } -// @has foo/mod4/index.html +//@ has foo/mod4/index.html #[stable(feature = "rust1", since = "1.0.0")] pub mod mod4 { - // @has - '//code' 'pub use tag::None;' - // @!has - '//span' 'Experimental' - // @!has - '//span' 'sync' + //@ has - '//code' 'pub use tag::None;' + //@ !has - '//span' 'Experimental' + //@ !has - '//span' 'sync' #[stable(feature = "rust1", since = "1.0.0")] pub use tag::None; } diff --git a/tests/rustdoc/reexports-of-same-name.rs b/tests/rustdoc/reexports-of-same-name.rs index fe6f1b38ca6..6e5d328b081 100644 --- a/tests/rustdoc/reexports-of-same-name.rs +++ b/tests/rustdoc/reexports-of-same-name.rs @@ -4,7 +4,7 @@ #![crate_name = "foo"] -// @has 'foo/index.html' +//@ has 'foo/index.html' pub mod nested { /// Foo the struct @@ -15,12 +15,12 @@ pub mod nested { pub fn Foo() {} } -// @count - '//*[@id="main-content"]//code' 'pub use nested::Foo;' 2 -// @has - '//*[@id="reexport.Foo"]//a[@href="nested/struct.Foo.html"]' 'Foo' -// @has - '//*[@id="reexport.Foo-1"]//a[@href="nested/fn.Foo.html"]' 'Foo' +//@ count - '//*[@id="main-content"]//code' 'pub use nested::Foo;' 2 +//@ has - '//*[@id="reexport.Foo"]//a[@href="nested/struct.Foo.html"]' 'Foo' +//@ has - '//*[@id="reexport.Foo-1"]//a[@href="nested/fn.Foo.html"]' 'Foo' pub use nested::Foo; -// @count - '//*[@id="main-content"]//code' 'pub use Foo as Bar;' 2 -// @has - '//*[@id="reexport.Bar"]//a[@href="nested/struct.Foo.html"]' 'Foo' -// @has - '//*[@id="reexport.Bar-1"]//a[@href="nested/fn.Foo.html"]' 'Foo' +//@ count - '//*[@id="main-content"]//code' 'pub use Foo as Bar;' 2 +//@ has - '//*[@id="reexport.Bar"]//a[@href="nested/struct.Foo.html"]' 'Foo' +//@ has - '//*[@id="reexport.Bar-1"]//a[@href="nested/fn.Foo.html"]' 'Foo' pub use Foo as Bar; diff --git a/tests/rustdoc/reexports-priv.rs b/tests/rustdoc/reexports-priv.rs index 97318a01410..4521b4feebc 100644 --- a/tests/rustdoc/reexports-priv.rs +++ b/tests/rustdoc/reexports-priv.rs @@ -5,131 +5,131 @@ extern crate reexports; -// @has 'foo/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {' +//@ has 'foo/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {' pub use reexports::addr_of; -// @!has 'foo/macro.addr_of_crate.html' +//@ !has 'foo/macro.addr_of_crate.html' pub(crate) use reexports::addr_of_crate; -// @!has 'foo/macro.addr_of_self.html' +//@ !has 'foo/macro.addr_of_self.html' pub(self) use reexports::addr_of_self; -// @!has 'foo/macro.addr_of_local.html' +//@ !has 'foo/macro.addr_of_local.html' use reexports::addr_of_local; -// @has 'foo/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;' +//@ has 'foo/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;' pub use reexports::Foo; -// @!has 'foo/struct.FooCrate.html' +//@ !has 'foo/struct.FooCrate.html' pub(crate) use reexports::FooCrate; -// @!has 'foo/struct.FooSelf.html' +//@ !has 'foo/struct.FooSelf.html' pub(self) use reexports::FooSelf; -// @!has 'foo/struct.FooLocal.html' +//@ !has 'foo/struct.FooLocal.html' use reexports::FooLocal; -// @has 'foo/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {' +//@ has 'foo/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {' pub use reexports::Bar; -// @!has 'foo/enum.BarCrate.html' +//@ !has 'foo/enum.BarCrate.html' pub(crate) use reexports::BarCrate; -// @!has 'foo/enum.BarSelf.html' +//@ !has 'foo/enum.BarSelf.html' pub(self) use reexports::BarSelf; -// @!has 'foo/enum.BarLocal.html' +//@ !has 'foo/enum.BarLocal.html' use reexports::BarLocal; -// @has 'foo/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()' +//@ has 'foo/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()' pub use reexports::foo; -// @!has 'foo/fn.foo_crate.html' +//@ !has 'foo/fn.foo_crate.html' pub(crate) use reexports::foo_crate; -// @!has 'foo/fn.foo_self.html' +//@ !has 'foo/fn.foo_self.html' pub(self) use reexports::foo_self; -// @!has 'foo/fn.foo_local.html' +//@ !has 'foo/fn.foo_local.html' use reexports::foo_local; -// @has 'foo/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type =' +//@ has 'foo/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type =' pub use reexports::Type; -// @!has 'foo/type.TypeCrate.html' +//@ !has 'foo/type.TypeCrate.html' pub(crate) use reexports::TypeCrate; -// @!has 'foo/type.TypeSelf.html' +//@ !has 'foo/type.TypeSelf.html' pub(self) use reexports::TypeSelf; -// @!has 'foo/type.TypeLocal.html' +//@ !has 'foo/type.TypeLocal.html' use reexports::TypeLocal; -// @has 'foo/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {' +//@ has 'foo/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {' pub use reexports::Union; -// @!has 'foo/union.UnionCrate.html' +//@ !has 'foo/union.UnionCrate.html' pub(crate) use reexports::UnionCrate; -// @!has 'foo/union.UnionSelf.html' +//@ !has 'foo/union.UnionSelf.html' pub(self) use reexports::UnionSelf; -// @!has 'foo/union.UnionLocal.html' +//@ !has 'foo/union.UnionLocal.html' use reexports::UnionLocal; pub mod outer { pub mod inner { - // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {' + //@ has 'foo/outer/inner/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {' pub use reexports::addr_of; - // @has 'foo/outer/inner/macro.addr_of_crate.html' '//*[@class="rust item-decl"]' 'pub(crate) macro addr_of_crate($place:expr) {' + //@ has 'foo/outer/inner/macro.addr_of_crate.html' '//*[@class="rust item-decl"]' 'pub(crate) macro addr_of_crate($place:expr) {' pub(crate) use reexports::addr_of_crate; - // @has 'foo/outer/inner/macro.addr_of_super.html' '//*[@class="rust item-decl"]' 'pub(in outer) macro addr_of_super($place:expr) {' + //@ has 'foo/outer/inner/macro.addr_of_super.html' '//*[@class="rust item-decl"]' 'pub(in outer) macro addr_of_super($place:expr) {' pub(super) use reexports::addr_of_super; - // @!has 'foo/outer/inner/macro.addr_of_self.html' + //@ !has 'foo/outer/inner/macro.addr_of_self.html' pub(self) use reexports::addr_of_self; - // @!has 'foo/outer/inner/macro.addr_of_local.html' + //@ !has 'foo/outer/inner/macro.addr_of_local.html' use reexports::addr_of_local; - // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;' + //@ has 'foo/outer/inner/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;' pub use reexports::Foo; - // @has 'foo/outer/inner/struct.FooCrate.html' '//*[@class="rust item-decl"]' 'pub(crate) struct FooCrate;' + //@ has 'foo/outer/inner/struct.FooCrate.html' '//*[@class="rust item-decl"]' 'pub(crate) struct FooCrate;' pub(crate) use reexports::FooCrate; - // @has 'foo/outer/inner/struct.FooSuper.html' '//*[@class="rust item-decl"]' 'pub(in outer) struct FooSuper;' + //@ has 'foo/outer/inner/struct.FooSuper.html' '//*[@class="rust item-decl"]' 'pub(in outer) struct FooSuper;' pub(super) use reexports::FooSuper; - // @!has 'foo/outer/inner/struct.FooSelf.html' + //@ !has 'foo/outer/inner/struct.FooSelf.html' pub(self) use reexports::FooSelf; - // @!has 'foo/outer/inner/struct.FooLocal.html' + //@ !has 'foo/outer/inner/struct.FooLocal.html' use reexports::FooLocal; - // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {' + //@ has 'foo/outer/inner/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {' pub use reexports::Bar; - // @has 'foo/outer/inner/enum.BarCrate.html' '//*[@class="rust item-decl"]' 'pub(crate) enum BarCrate {' + //@ has 'foo/outer/inner/enum.BarCrate.html' '//*[@class="rust item-decl"]' 'pub(crate) enum BarCrate {' pub(crate) use reexports::BarCrate; - // @has 'foo/outer/inner/enum.BarSuper.html' '//*[@class="rust item-decl"]' 'pub(in outer) enum BarSuper {' + //@ has 'foo/outer/inner/enum.BarSuper.html' '//*[@class="rust item-decl"]' 'pub(in outer) enum BarSuper {' pub(super) use reexports::BarSuper; - // @!has 'foo/outer/inner/enum.BarSelf.html' + //@ !has 'foo/outer/inner/enum.BarSelf.html' pub(self) use reexports::BarSelf; - // @!has 'foo/outer/inner/enum.BarLocal.html' + //@ !has 'foo/outer/inner/enum.BarLocal.html' use reexports::BarLocal; - // @has 'foo/outer/inner/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()' + //@ has 'foo/outer/inner/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()' pub use reexports::foo; - // @has 'foo/outer/inner/fn.foo_crate.html' '//pre[@class="rust item-decl"]' 'pub(crate) fn foo_crate()' + //@ has 'foo/outer/inner/fn.foo_crate.html' '//pre[@class="rust item-decl"]' 'pub(crate) fn foo_crate()' pub(crate) use reexports::foo_crate; - // @has 'foo/outer/inner/fn.foo_super.html' '//pre[@class="rust item-decl"]' 'pub(in outer) fn foo_super()' + //@ has 'foo/outer/inner/fn.foo_super.html' '//pre[@class="rust item-decl"]' 'pub(in outer) fn foo_super()' pub(super) use::reexports::foo_super; - // @!has 'foo/outer/inner/fn.foo_self.html' + //@ !has 'foo/outer/inner/fn.foo_self.html' pub(self) use reexports::foo_self; - // @!has 'foo/outer/inner/fn.foo_local.html' + //@ !has 'foo/outer/inner/fn.foo_local.html' use reexports::foo_local; - // @has 'foo/outer/inner/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type =' + //@ has 'foo/outer/inner/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type =' pub use reexports::Type; - // @has 'foo/outer/inner/type.TypeCrate.html' '//pre[@class="rust item-decl"]' 'pub(crate) type TypeCrate =' + //@ has 'foo/outer/inner/type.TypeCrate.html' '//pre[@class="rust item-decl"]' 'pub(crate) type TypeCrate =' pub(crate) use reexports::TypeCrate; - // @has 'foo/outer/inner/type.TypeSuper.html' '//pre[@class="rust item-decl"]' 'pub(in outer) type TypeSuper =' + //@ has 'foo/outer/inner/type.TypeSuper.html' '//pre[@class="rust item-decl"]' 'pub(in outer) type TypeSuper =' pub(super) use reexports::TypeSuper; - // @!has 'foo/outer/inner/type.TypeSelf.html' + //@ !has 'foo/outer/inner/type.TypeSelf.html' pub(self) use reexports::TypeSelf; - // @!has 'foo/outer/inner/type.TypeLocal.html' + //@ !has 'foo/outer/inner/type.TypeLocal.html' use reexports::TypeLocal; - // @has 'foo/outer/inner/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {' + //@ has 'foo/outer/inner/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {' pub use reexports::Union; - // @has 'foo/outer/inner/union.UnionCrate.html' '//*[@class="rust item-decl"]' 'pub(crate) union UnionCrate {' + //@ has 'foo/outer/inner/union.UnionCrate.html' '//*[@class="rust item-decl"]' 'pub(crate) union UnionCrate {' pub(crate) use reexports::UnionCrate; - // @has 'foo/outer/inner/union.UnionSuper.html' '//*[@class="rust item-decl"]' 'pub(in outer) union UnionSuper {' + //@ has 'foo/outer/inner/union.UnionSuper.html' '//*[@class="rust item-decl"]' 'pub(in outer) union UnionSuper {' pub(super) use reexports::UnionSuper; - // @!has 'foo/outer/inner/union.UnionSelf.html' + //@ !has 'foo/outer/inner/union.UnionSelf.html' pub(self) use reexports::UnionSelf; - // @!has 'foo/outer/inner/union.UnionLocal.html' + //@ !has 'foo/outer/inner/union.UnionLocal.html' use reexports::UnionLocal; } } mod re_re_exports { - // @!has 'foo/re_re_exports/union.Union.html' + //@ !has 'foo/re_re_exports/union.Union.html' use crate::reexports::Union; } diff --git a/tests/rustdoc/reexports.rs b/tests/rustdoc/reexports.rs index e1da1fd552f..b17e9cd719a 100644 --- a/tests/rustdoc/reexports.rs +++ b/tests/rustdoc/reexports.rs @@ -4,126 +4,126 @@ extern crate reexports; -// @has 'foo/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {' +//@ has 'foo/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {' pub use reexports::addr_of; -// @!has 'foo/macro.addr_of_crate.html' +//@ !has 'foo/macro.addr_of_crate.html' pub(crate) use reexports::addr_of_crate; -// @!has 'foo/macro.addr_of_self.html' +//@ !has 'foo/macro.addr_of_self.html' pub(self) use reexports::addr_of_self; -// @!has 'foo/macro.addr_of_local.html' +//@ !has 'foo/macro.addr_of_local.html' use reexports::addr_of_local; -// @has 'foo/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;' +//@ has 'foo/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;' pub use reexports::Foo; -// @!has 'foo/struct.FooCrate.html' +//@ !has 'foo/struct.FooCrate.html' pub(crate) use reexports::FooCrate; -// @!has 'foo/struct.FooSelf.html' +//@ !has 'foo/struct.FooSelf.html' pub(self) use reexports::FooSelf; -// @!has 'foo/struct.FooLocal.html' +//@ !has 'foo/struct.FooLocal.html' use reexports::FooLocal; -// @has 'foo/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {' +//@ has 'foo/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {' pub use reexports::Bar; -// @!has 'foo/enum.BarCrate.html' +//@ !has 'foo/enum.BarCrate.html' pub(crate) use reexports::BarCrate; -// @!has 'foo/enum.BarSelf.html' +//@ !has 'foo/enum.BarSelf.html' pub(self) use reexports::BarSelf; -// @!has 'foo/enum.BarLocal.html' +//@ !has 'foo/enum.BarLocal.html' use reexports::BarLocal; -// @has 'foo/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()' +//@ has 'foo/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()' pub use reexports::foo; -// @!has 'foo/fn.foo_crate.html' +//@ !has 'foo/fn.foo_crate.html' pub(crate) use reexports::foo_crate; -// @!has 'foo/fn.foo_self.html' +//@ !has 'foo/fn.foo_self.html' pub(self) use reexports::foo_self; -// @!has 'foo/fn.foo_local.html' +//@ !has 'foo/fn.foo_local.html' use reexports::foo_local; -// @has 'foo/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type =' +//@ has 'foo/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type =' pub use reexports::Type; -// @!has 'foo/type.TypeCrate.html' +//@ !has 'foo/type.TypeCrate.html' pub(crate) use reexports::TypeCrate; -// @!has 'foo/type.TypeSelf.html' +//@ !has 'foo/type.TypeSelf.html' pub(self) use reexports::TypeSelf; -// @!has 'foo/type.TypeLocal.html' +//@ !has 'foo/type.TypeLocal.html' use reexports::TypeLocal; -// @has 'foo/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {' +//@ has 'foo/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {' pub use reexports::Union; -// @!has 'foo/union.UnionCrate.html' +//@ !has 'foo/union.UnionCrate.html' pub(crate) use reexports::UnionCrate; -// @!has 'foo/union.UnionSelf.html' +//@ !has 'foo/union.UnionSelf.html' pub(self) use reexports::UnionSelf; -// @!has 'foo/union.UnionLocal.html' +//@ !has 'foo/union.UnionLocal.html' use reexports::UnionLocal; pub mod outer { pub mod inner { - // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {' + //@ has 'foo/outer/inner/macro.addr_of.html' '//*[@class="rust item-decl"]' 'pub macro addr_of($place:expr) {' pub use reexports::addr_of; - // @!has 'foo/outer/inner/macro.addr_of_crate.html' + //@ !has 'foo/outer/inner/macro.addr_of_crate.html' pub(crate) use reexports::addr_of_crate; - // @!has 'foo/outer/inner/macro.addr_of_super.html' + //@ !has 'foo/outer/inner/macro.addr_of_super.html' pub(super) use reexports::addr_of_super; - // @!has 'foo/outer/inner/macro.addr_of_self.html' + //@ !has 'foo/outer/inner/macro.addr_of_self.html' pub(self) use reexports::addr_of_self; - // @!has 'foo/outer/inner/macro.addr_of_local.html' + //@ !has 'foo/outer/inner/macro.addr_of_local.html' use reexports::addr_of_local; - // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;' + //@ has 'foo/outer/inner/struct.Foo.html' '//*[@class="rust item-decl"]' 'pub struct Foo;' pub use reexports::Foo; - // @!has 'foo/outer/inner/struct.FooCrate.html' + //@ !has 'foo/outer/inner/struct.FooCrate.html' pub(crate) use reexports::FooCrate; - // @!has 'foo/outer/inner/struct.FooSuper.html' + //@ !has 'foo/outer/inner/struct.FooSuper.html' pub(super) use reexports::FooSuper; - // @!has 'foo/outer/inner/struct.FooSelf.html' + //@ !has 'foo/outer/inner/struct.FooSelf.html' pub(self) use reexports::FooSelf; - // @!has 'foo/outer/inner/struct.FooLocal.html' + //@ !has 'foo/outer/inner/struct.FooLocal.html' use reexports::FooLocal; - // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {' + //@ has 'foo/outer/inner/enum.Bar.html' '//*[@class="rust item-decl"]' 'pub enum Bar {' pub use reexports::Bar; - // @!has 'foo/outer/inner/enum.BarCrate.html' + //@ !has 'foo/outer/inner/enum.BarCrate.html' pub(crate) use reexports::BarCrate; - // @!has 'foo/outer/inner/enum.BarSuper.html' + //@ !has 'foo/outer/inner/enum.BarSuper.html' pub(super) use reexports::BarSuper; - // @!has 'foo/outer/inner/enum.BarSelf.html' + //@ !has 'foo/outer/inner/enum.BarSelf.html' pub(self) use reexports::BarSelf; - // @!has 'foo/outer/inner/enum.BarLocal.html' + //@ !has 'foo/outer/inner/enum.BarLocal.html' use reexports::BarLocal; - // @has 'foo/outer/inner/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()' + //@ has 'foo/outer/inner/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo()' pub use reexports::foo; - // @!has 'foo/outer/inner/fn.foo_crate.html' + //@ !has 'foo/outer/inner/fn.foo_crate.html' pub(crate) use reexports::foo_crate; - // @!has 'foo/outer/inner/fn.foo_super.html' + //@ !has 'foo/outer/inner/fn.foo_super.html' pub(super) use::reexports::foo_super; - // @!has 'foo/outer/inner/fn.foo_self.html' + //@ !has 'foo/outer/inner/fn.foo_self.html' pub(self) use reexports::foo_self; - // @!has 'foo/outer/inner/fn.foo_local.html' + //@ !has 'foo/outer/inner/fn.foo_local.html' use reexports::foo_local; - // @has 'foo/outer/inner/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type =' + //@ has 'foo/outer/inner/type.Type.html' '//pre[@class="rust item-decl"]' 'pub type Type =' pub use reexports::Type; - // @!has 'foo/outer/inner/type.TypeCrate.html' + //@ !has 'foo/outer/inner/type.TypeCrate.html' pub(crate) use reexports::TypeCrate; - // @!has 'foo/outer/inner/type.TypeSuper.html' + //@ !has 'foo/outer/inner/type.TypeSuper.html' pub(super) use reexports::TypeSuper; - // @!has 'foo/outer/inner/type.TypeSelf.html' + //@ !has 'foo/outer/inner/type.TypeSelf.html' pub(self) use reexports::TypeSelf; - // @!has 'foo/outer/inner/type.TypeLocal.html' + //@ !has 'foo/outer/inner/type.TypeLocal.html' use reexports::TypeLocal; - // @has 'foo/outer/inner/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {' + //@ has 'foo/outer/inner/union.Union.html' '//*[@class="rust item-decl"]' 'pub union Union {' pub use reexports::Union; - // @!has 'foo/outer/inner/union.UnionCrate.html' + //@ !has 'foo/outer/inner/union.UnionCrate.html' pub(crate) use reexports::UnionCrate; - // @!has 'foo/outer/inner/union.UnionSuper.html' + //@ !has 'foo/outer/inner/union.UnionSuper.html' pub(super) use reexports::UnionSuper; - // @!has 'foo/outer/inner/union.UnionSelf.html' + //@ !has 'foo/outer/inner/union.UnionSelf.html' pub(self) use reexports::UnionSelf; - // @!has 'foo/outer/inner/union.UnionLocal.html' + //@ !has 'foo/outer/inner/union.UnionLocal.html' use reexports::UnionLocal; } } diff --git a/tests/rustdoc/remove-duplicates.rs b/tests/rustdoc/remove-duplicates.rs index 759bf84db62..1e5bf9b0198 100644 --- a/tests/rustdoc/remove-duplicates.rs +++ b/tests/rustdoc/remove-duplicates.rs @@ -9,6 +9,6 @@ mod foo { } } -// @count foo/index.html '//*[@class="trait"]' 1 +//@ count foo/index.html '//*[@class="trait"]' 1 pub use foo::bar::*; pub use foo::*; diff --git a/tests/rustdoc/remove-url-from-headings.rs b/tests/rustdoc/remove-url-from-headings.rs index 8f477028619..6e15f57e7ba 100644 --- a/tests/rustdoc/remove-url-from-headings.rs +++ b/tests/rustdoc/remove-url-from-headings.rs @@ -2,11 +2,11 @@ #![crate_name = "foo"] -// @has foo/fn.foo.html -// @has - '//a[@href="http://a.a"]' 'stuff' -// @has - '//*[@id="implementing-stuff-somewhere"]' 'Implementing stuff somewhere' -// @has - '//a[@href="http://b.b"]' 'one' -// @has - '//*[@id="another-one-urg"]' 'Another one urg' +//@ has foo/fn.foo.html +//@ has - '//a[@href="http://a.a"]' 'stuff' +//@ has - '//*[@id="implementing-stuff-somewhere"]' 'Implementing stuff somewhere' +//@ has - '//a[@href="http://b.b"]' 'one' +//@ has - '//*[@id="another-one-urg"]' 'Another one urg' /// fooo /// diff --git a/tests/rustdoc/render-enum-variant-structlike-32395.rs b/tests/rustdoc/render-enum-variant-structlike-32395.rs index dbe40304c17..d4cefb2911d 100644 --- a/tests/rustdoc/render-enum-variant-structlike-32395.rs +++ b/tests/rustdoc/render-enum-variant-structlike-32395.rs @@ -5,14 +5,14 @@ // https://github.com/rust-lang/rust/issues/32395 #![crate_name="issue_32395"] -// @has variant_struct/enum.Foo.html -// @!hasraw - 'pub qux' -// @!hasraw - 'pub(crate) qux' -// @!hasraw - 'pub Bar' +//@ has variant_struct/enum.Foo.html +//@ !hasraw - 'pub qux' +//@ !hasraw - 'pub(crate) qux' +//@ !hasraw - 'pub Bar' extern crate variant_struct; -// @has issue_32395/enum.Foo.html -// @!hasraw - 'pub qux' -// @!hasraw - 'pub(crate) qux' -// @!hasraw - 'pub Bar' +//@ has issue_32395/enum.Foo.html +//@ !hasraw - 'pub qux' +//@ !hasraw - 'pub(crate) qux' +//@ !hasraw - 'pub Bar' pub use variant_struct::Foo; diff --git a/tests/rustdoc/repr.rs b/tests/rustdoc/repr.rs index fbb46e126ba..f4f683b3d81 100644 --- a/tests/rustdoc/repr.rs +++ b/tests/rustdoc/repr.rs @@ -2,15 +2,15 @@ // Check that we show `#[repr(transparent)]` iff the non-1-ZST field is public or at least one // field is public in case all fields are 1-ZST fields. -// @has 'repr/struct.ReprTransparentPrivField.html' -// @!has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' +//@ has 'repr/struct.ReprTransparentPrivField.html' +//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' #[repr(transparent)] // private pub struct ReprTransparentPrivField { field: u32, // non-1-ZST field } -// @has 'repr/struct.ReprTransparentPriv1ZstFields.html' -// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' +//@ has 'repr/struct.ReprTransparentPriv1ZstFields.html' +//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' #[repr(transparent)] // public pub struct ReprTransparentPriv1ZstFields { marker0: Marker, @@ -18,8 +18,8 @@ pub struct ReprTransparentPriv1ZstFields { marker1: Marker, } -// @has 'repr/struct.ReprTransparentPub1ZstField.html' -// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' +//@ has 'repr/struct.ReprTransparentPub1ZstField.html' +//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]' #[repr(transparent)] // public pub struct ReprTransparentPub1ZstField { marker0: Marker, diff --git a/tests/rustdoc/return-impl-trait.rs b/tests/rustdoc/return-impl-trait.rs index 1ccf5ac4611..175867d2204 100644 --- a/tests/rustdoc/return-impl-trait.rs +++ b/tests/rustdoc/return-impl-trait.rs @@ -8,7 +8,7 @@ pub struct Module(T); pub type BackendImpl = impl Backend; -// @has return_impl_trait/fn.make_module.html +//@ has return_impl_trait/fn.make_module.html /// Documentation pub fn make_module() -> Module { Module(()) diff --git a/tests/rustdoc/rfc-2632-const-trait-impl.rs b/tests/rustdoc/rfc-2632-const-trait-impl.rs index d165a406f56..f6a5555dbad 100644 --- a/tests/rustdoc/rfc-2632-const-trait-impl.rs +++ b/tests/rustdoc/rfc-2632-const-trait-impl.rs @@ -15,16 +15,16 @@ use std::marker::Destruct; pub struct S(T); -// @!has foo/trait.Tr.html '//pre[@class="rust item-decl"]/code/a[@class="trait"]' '~const' -// @has - '//pre[@class="rust item-decl"]/code/a[@class="trait"]' 'Fn' -// @!has - '//pre[@class="rust item-decl"]/code/span[@class="where"]' '~const' -// @has - '//pre[@class="rust item-decl"]/code/span[@class="where"]' ': Fn' +//@ !has foo/trait.Tr.html '//pre[@class="rust item-decl"]/code/a[@class="trait"]' '~const' +//@ has - '//pre[@class="rust item-decl"]/code/a[@class="trait"]' 'Fn' +//@ !has - '//pre[@class="rust item-decl"]/code/span[@class="where"]' '~const' +//@ has - '//pre[@class="rust item-decl"]/code/span[@class="where"]' ': Fn' #[const_trait] pub trait Tr { - // @!has - '//section[@id="method.a"]/h4[@class="code-header"]' '~const' - // @has - '//section[@id="method.a"]/h4[@class="code-header"]/a[@class="trait"]' 'Fn' - // @!has - '//section[@id="method.a"]/h4[@class="code-header"]/span[@class="where"]' '~const' - // @has - '//section[@id="method.a"]/h4[@class="code-header"]/div[@class="where"]' ': Fn' + //@ !has - '//section[@id="method.a"]/h4[@class="code-header"]' '~const' + //@ has - '//section[@id="method.a"]/h4[@class="code-header"]/a[@class="trait"]' 'Fn' + //@ !has - '//section[@id="method.a"]/h4[@class="code-header"]/span[@class="where"]' '~const' + //@ has - '//section[@id="method.a"]/h4[@class="code-header"]/div[@class="where"]' ': Fn' fn a() where Option: /* ~const */ Fn() /* + ~const Destruct */, @@ -32,11 +32,11 @@ pub trait Tr { } } -// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]' '' -// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]' '~const' -// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/a[@class="trait"]' 'Fn' -// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/span[@class="where"]' '~const' -// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/div[@class="where"]' ': Fn' +//@ has - '//section[@id="impl-Tr%3CT%3E-for-T"]' '' +//@ !has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]' '~const' +//@ has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/a[@class="trait"]' 'Fn' +//@ !has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/span[@class="where"]' '~const' +//@ has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/div[@class="where"]' ': Fn' impl const Tr for T where Option: /* ~const */ Fn() /* + ~const Destruct */, @@ -48,10 +48,10 @@ where } } -// @!has foo/fn.foo.html '//pre[@class="rust item-decl"]/code/a[@class="trait"]' '~const' -// @has - '//pre[@class="rust item-decl"]/code/a[@class="trait"]' 'Fn' -// @!has - '//pre[@class="rust item-decl"]/code/div[@class="where"]' '~const' -// @has - '//pre[@class="rust item-decl"]/code/div[@class="where"]' ': Fn' +//@ !has foo/fn.foo.html '//pre[@class="rust item-decl"]/code/a[@class="trait"]' '~const' +//@ has - '//pre[@class="rust item-decl"]/code/a[@class="trait"]' 'Fn' +//@ !has - '//pre[@class="rust item-decl"]/code/div[@class="where"]' '~const' +//@ has - '//pre[@class="rust item-decl"]/code/div[@class="where"]' ': Fn' pub const fn foo() where Option: /* ~const */ Fn() /* + ~const Destruct */, @@ -60,10 +60,10 @@ where } impl S { - // @!has foo/struct.S.html '//section[@id="method.foo"]/h4[@class="code-header"]' '~const' - // @has - '//section[@id="method.foo"]/h4[@class="code-header"]/a[@class="trait"]' 'Fn' - // @!has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where"]' '~const' - // @has - '//section[@id="method.foo"]/h4[@class="code-header"]/div[@class="where"]' ': Fn' + //@ !has foo/struct.S.html '//section[@id="method.foo"]/h4[@class="code-header"]' '~const' + //@ has - '//section[@id="method.foo"]/h4[@class="code-header"]/a[@class="trait"]' 'Fn' + //@ !has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where"]' '~const' + //@ has - '//section[@id="method.foo"]/h4[@class="code-header"]/div[@class="where"]' ': Fn' pub const fn foo() where B: /* ~const */ Fn() /* + ~const Destruct */, diff --git a/tests/rustdoc/rustc-incoherent-impls.rs b/tests/rustdoc/rustc-incoherent-impls.rs index 4f0eca291f7..81a7025906b 100644 --- a/tests/rustdoc/rustc-incoherent-impls.rs +++ b/tests/rustdoc/rustc-incoherent-impls.rs @@ -10,8 +10,8 @@ extern crate incoherent_impl_types; #[doc(inline)] pub use incoherent_impl_types::FooTrait; -// @has foo/trait.FooTrait.html -// @count - '//section[@id="method.do_something"]' 1 +//@ has foo/trait.FooTrait.html +//@ count - '//section[@id="method.do_something"]' 1 impl dyn FooTrait { #[rustc_allow_incoherent_impl] pub fn do_something() {} @@ -20,8 +20,8 @@ impl dyn FooTrait { #[doc(inline)] pub use incoherent_impl_types::FooStruct; -// @has foo/struct.FooStruct.html -// @count - '//section[@id="method.do_something"]' 1 +//@ has foo/struct.FooStruct.html +//@ count - '//section[@id="method.do_something"]' 1 impl FooStruct { #[rustc_allow_incoherent_impl] pub fn do_something() {} diff --git a/tests/rustdoc/safe-intrinsic.rs b/tests/rustdoc/safe-intrinsic.rs index c508909f9aa..b46ffed99c3 100644 --- a/tests/rustdoc/safe-intrinsic.rs +++ b/tests/rustdoc/safe-intrinsic.rs @@ -6,17 +6,17 @@ #![crate_name = "foo"] extern "rust-intrinsic" { - // @has 'foo/fn.abort.html' - // @has - '//pre[@class="rust item-decl"]' 'pub extern "rust-intrinsic" fn abort() -> !' + //@ has 'foo/fn.abort.html' + //@ has - '//pre[@class="rust item-decl"]' 'pub extern "rust-intrinsic" fn abort() -> !' #[rustc_safe_intrinsic] pub fn abort() -> !; - // @has 'foo/fn.unreachable.html' - // @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !' + //@ has 'foo/fn.unreachable.html' + //@ has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !' pub fn unreachable() -> !; } extern "C" { - // @has 'foo/fn.needs_drop.html' - // @has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn needs_drop() -> !' + //@ has 'foo/fn.needs_drop.html' + //@ has - '//pre[@class="rust item-decl"]' 'pub unsafe extern "C" fn needs_drop() -> !' pub fn needs_drop() -> !; } diff --git a/tests/rustdoc/same-crate-hidden-impl-parameter.rs b/tests/rustdoc/same-crate-hidden-impl-parameter.rs index d55393af859..b0beb1bdfa0 100644 --- a/tests/rustdoc/same-crate-hidden-impl-parameter.rs +++ b/tests/rustdoc/same-crate-hidden-impl-parameter.rs @@ -9,7 +9,7 @@ pub trait HiddenTrait {} pub enum MyLibType {} -// @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CHiddenType%3E"]' 'impl From for MyLibType' +//@ !has foo/enum.MyLibType.html '//*[@id="impl-From%3CHiddenType%3E"]' 'impl From for MyLibType' impl From for MyLibType { fn from(it: HiddenType) -> MyLibType { match it {} @@ -18,17 +18,17 @@ impl From for MyLibType { pub struct T(T); -// @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From>>>> for MyLibType' +//@ !has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From>>>> for MyLibType' impl From>>>> for MyLibType { fn from(it: T>>>) -> MyLibType { todo!() } } -// @!has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType' +//@ !has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType' impl HiddenTrait for MyLibType {} -// @!has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From for T>>>' +//@ !has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From for T>>>' impl From for T>>> { fn from(it: MyLibType) -> T>>> { match it {} diff --git a/tests/rustdoc/search-index-primitive-inherent-method-23511.rs b/tests/rustdoc/search-index-primitive-inherent-method-23511.rs index 1d0fe27e192..6054d8f12f5 100644 --- a/tests/rustdoc/search-index-primitive-inherent-method-23511.rs +++ b/tests/rustdoc/search-index-primitive-inherent-method-23511.rs @@ -9,7 +9,7 @@ pub mod str { #![rustc_doc_primitive = "str"] impl str { - // @hasraw search-index.js foo + //@ hasraw search-index.js foo #[rustc_allow_incoherent_impl] pub fn foo(&self) {} } diff --git a/tests/rustdoc/search-index-summaries.rs b/tests/rustdoc/search-index-summaries.rs index 529b42d0ca9..55db04340a6 100644 --- a/tests/rustdoc/search-index-summaries.rs +++ b/tests/rustdoc/search-index-summaries.rs @@ -1,8 +1,8 @@ #![crate_name = "foo"] -// @hasraw 'search.desc/foo/foo-desc-0-.js' 'Foo short link.' -// @!hasraw - 'www.example.com' -// @!hasraw - 'More Foo.' +//@ hasraw 'search.desc/foo/foo-desc-0-.js' 'Foo short link.' +//@ !hasraw - 'www.example.com' +//@ !hasraw - 'More Foo.' /// Foo short [link](https://www.example.com/). /// diff --git a/tests/rustdoc/search-index.rs b/tests/rustdoc/search-index.rs index d1d05eb886b..f53862ede38 100644 --- a/tests/rustdoc/search-index.rs +++ b/tests/rustdoc/search-index.rs @@ -2,25 +2,25 @@ use std::ops::Deref; -// @hasraw search-index.js Foo +//@ hasraw search-index.js Foo pub use private::Foo; mod private { pub struct Foo; impl Foo { - pub fn test_method() {} // @hasraw - test_method - fn priv_method() {} // @!hasraw - priv_method + pub fn test_method() {} //@ hasraw - test_method + fn priv_method() {} //@ !hasraw - priv_method } pub trait PrivateTrait { - fn trait_method(&self) {} // @!hasraw - priv_method + fn trait_method(&self) {} //@ !hasraw - priv_method } } pub struct Bar; impl Deref for Bar { - // @!hasraw search-index.js Target + //@ !hasraw search-index.js Target type Target = Bar; fn deref(&self) -> &Bar { self } } diff --git a/tests/rustdoc/short-docblock-codeblock.rs b/tests/rustdoc/short-docblock-codeblock.rs index 7ecd80b8c72..82486a9ea2d 100644 --- a/tests/rustdoc/short-docblock-codeblock.rs +++ b/tests/rustdoc/short-docblock-codeblock.rs @@ -1,6 +1,6 @@ #![crate_name = "foo"] -// @count foo/index.html '//*[@class="desc docblock-short"]' 0 +//@ count foo/index.html '//*[@class="desc docblock-short"]' 0 /// ``` /// let x = 12; diff --git a/tests/rustdoc/short-docblock.rs b/tests/rustdoc/short-docblock.rs index 151a42a9c9e..c80a5025ebe 100644 --- a/tests/rustdoc/short-docblock.rs +++ b/tests/rustdoc/short-docblock.rs @@ -1,26 +1,26 @@ #![crate_name = "foo"] -// @has foo/index.html '//*[@class="desc docblock-short"]' 'fooo' -// @!has foo/index.html '//*[@class="desc docblock-short"]/h1' 'fooo' +//@ has foo/index.html '//*[@class="desc docblock-short"]' 'fooo' +//@ !has foo/index.html '//*[@class="desc docblock-short"]/h1' 'fooo' -// @has foo/fn.foo.html '//h2[@id="fooo"]' 'fooo' -// @has foo/fn.foo.html '//h2[@id="fooo"]/a[@href="#fooo"]' '§' +//@ has foo/fn.foo.html '//h2[@id="fooo"]' 'fooo' +//@ has foo/fn.foo.html '//h2[@id="fooo"]/a[@href="#fooo"]' '§' /// # fooo /// /// foo pub fn foo() {} -// @has foo/index.html '//*[@class="desc docblock-short"]' 'mooood' -// @!has foo/index.html '//*[@class="desc docblock-short"]/h2' 'mooood' +//@ has foo/index.html '//*[@class="desc docblock-short"]' 'mooood' +//@ !has foo/index.html '//*[@class="desc docblock-short"]/h2' 'mooood' -// @has foo/foo/index.html '//h3[@id="mooood"]' 'mooood' -// @has foo/foo/index.html '//h3[@id="mooood"]/a[@href="#mooood"]' '§' +//@ has foo/foo/index.html '//h3[@id="mooood"]' 'mooood' +//@ has foo/foo/index.html '//h3[@id="mooood"]/a[@href="#mooood"]' '§' /// ## mooood /// /// foo mod pub mod foo {} -// @has foo/index.html '//*[@class="desc docblock-short"]/a[@href=\ +//@ has foo/index.html '//*[@class="desc docblock-short"]/a[@href=\ // "https://nougat.world"]/code' 'nougat' /// [`nougat`](https://nougat.world) diff --git a/tests/rustdoc/show-const-contents.rs b/tests/rustdoc/show-const-contents.rs index 91df03adbbc..6d2701693ce 100644 --- a/tests/rustdoc/show-const-contents.rs +++ b/tests/rustdoc/show-const-contents.rs @@ -1,57 +1,57 @@ // Test that the contents of constants are displayed as part of the // documentation. -// @hasraw show_const_contents/constant.CONST_S.html 'show this' -// @!hasraw show_const_contents/constant.CONST_S.html '; //' +//@ hasraw show_const_contents/constant.CONST_S.html 'show this' +//@ !hasraw show_const_contents/constant.CONST_S.html '; //' pub const CONST_S: &'static str = "show this"; -// @hasraw show_const_contents/constant.CONST_I32.html '= 42;' -// @!hasraw show_const_contents/constant.CONST_I32.html '; //' +//@ hasraw show_const_contents/constant.CONST_I32.html '= 42;' +//@ !hasraw show_const_contents/constant.CONST_I32.html '; //' pub const CONST_I32: i32 = 42; -// @hasraw show_const_contents/constant.CONST_I32_HEX.html '= 0x42;' -// @!hasraw show_const_contents/constant.CONST_I32_HEX.html '; //' +//@ hasraw show_const_contents/constant.CONST_I32_HEX.html '= 0x42;' +//@ !hasraw show_const_contents/constant.CONST_I32_HEX.html '; //' pub const CONST_I32_HEX: i32 = 0x42; -// @hasraw show_const_contents/constant.CONST_NEG_I32.html '= -42;' -// @!hasraw show_const_contents/constant.CONST_NEG_I32.html '; //' +//@ hasraw show_const_contents/constant.CONST_NEG_I32.html '= -42;' +//@ !hasraw show_const_contents/constant.CONST_NEG_I32.html '; //' pub const CONST_NEG_I32: i32 = -42; -// @hasraw show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '= 42i32;' -// @!hasraw show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '// 42i32' +//@ hasraw show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '= 42i32;' +//@ !hasraw show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '// 42i32' pub const CONST_EQ_TO_VALUE_I32: i32 = 42i32; -// @hasraw show_const_contents/constant.CONST_CALC_I32.html '= _; // 43i32' +//@ hasraw show_const_contents/constant.CONST_CALC_I32.html '= _; // 43i32' pub const CONST_CALC_I32: i32 = 42 + 1; -// @!hasraw show_const_contents/constant.CONST_REF_I32.html '= &42;' -// @!hasraw show_const_contents/constant.CONST_REF_I32.html '; //' +//@ !hasraw show_const_contents/constant.CONST_REF_I32.html '= &42;' +//@ !hasraw show_const_contents/constant.CONST_REF_I32.html '; //' pub const CONST_REF_I32: &'static i32 = &42; -// @hasraw show_const_contents/constant.CONST_I32_MAX.html '= i32::MAX; // 2_147_483_647i32' +//@ hasraw show_const_contents/constant.CONST_I32_MAX.html '= i32::MAX; // 2_147_483_647i32' pub const CONST_I32_MAX: i32 = i32::MAX; -// @!hasraw show_const_contents/constant.UNIT.html '= ();' -// @!hasraw show_const_contents/constant.UNIT.html '; //' +//@ !hasraw show_const_contents/constant.UNIT.html '= ();' +//@ !hasraw show_const_contents/constant.UNIT.html '; //' pub const UNIT: () = (); pub struct MyType(i32); -// @!hasraw show_const_contents/constant.MY_TYPE.html '= MyType(42);' -// @!hasraw show_const_contents/constant.MY_TYPE.html '; //' +//@ !hasraw show_const_contents/constant.MY_TYPE.html '= MyType(42);' +//@ !hasraw show_const_contents/constant.MY_TYPE.html '; //' pub const MY_TYPE: MyType = MyType(42); pub struct MyTypeWithStr(&'static str); -// @!hasraw show_const_contents/constant.MY_TYPE_WITH_STR.html '= MyTypeWithStr("show this");' -// @!hasraw show_const_contents/constant.MY_TYPE_WITH_STR.html '; //' +//@ !hasraw show_const_contents/constant.MY_TYPE_WITH_STR.html '= MyTypeWithStr("show this");' +//@ !hasraw show_const_contents/constant.MY_TYPE_WITH_STR.html '; //' pub const MY_TYPE_WITH_STR: MyTypeWithStr = MyTypeWithStr("show this"); -// @hasraw show_const_contents/constant.PI.html '= 3.14159265358979323846264338327950288_f32;' -// @hasraw show_const_contents/constant.PI.html '; // 3.14159274f32' +//@ hasraw show_const_contents/constant.PI.html '= 3.14159265358979323846264338327950288_f32;' +//@ hasraw show_const_contents/constant.PI.html '; // 3.14159274f32' pub use std::f32::consts::PI; -// @hasraw show_const_contents/constant.MAX.html '= i32::MAX; // 2_147_483_647i32' +//@ hasraw show_const_contents/constant.MAX.html '= i32::MAX; // 2_147_483_647i32' #[allow(deprecated, deprecated_in_future)] pub use std::i32::MAX; @@ -61,8 +61,8 @@ macro_rules! int_module { ) } -// @hasraw show_const_contents/constant.MIN.html '= i16::MIN; // -32_768i16' +//@ hasraw show_const_contents/constant.MIN.html '= i16::MIN; // -32_768i16' int_module!(i16); -// @has show_const_contents/constant.ESCAPE.html //pre '= r#""#;' +//@ has show_const_contents/constant.ESCAPE.html //pre '= r#""#;' pub const ESCAPE: &str = r#""#; diff --git a/tests/rustdoc/sidebar-all-page.rs b/tests/rustdoc/sidebar-all-page.rs index 4c8a0f543a5..1f97a414048 100644 --- a/tests/rustdoc/sidebar-all-page.rs +++ b/tests/rustdoc/sidebar-all-page.rs @@ -1,17 +1,17 @@ #![crate_name = "foo"] #![feature(rustc_attrs)] -// @has 'foo/all.html' -// @has - '//*[@class="sidebar-elems"]//li' 'Structs' -// @has - '//*[@class="sidebar-elems"]//li' 'Enums' -// @has - '//*[@class="sidebar-elems"]//li' 'Unions' -// @has - '//*[@class="sidebar-elems"]//li' 'Functions' -// @has - '//*[@class="sidebar-elems"]//li' 'Traits' -// @has - '//*[@class="sidebar-elems"]//li' 'Macros' -// @has - '//*[@class="sidebar-elems"]//li' 'Type Aliases' -// @has - '//*[@class="sidebar-elems"]//li' 'Constants' -// @has - '//*[@class="sidebar-elems"]//li' 'Statics' -// @has - '//*[@class="sidebar-elems"]//li' 'Primitive Types' +//@ has 'foo/all.html' +//@ has - '//*[@class="sidebar-elems"]//li' 'Structs' +//@ has - '//*[@class="sidebar-elems"]//li' 'Enums' +//@ has - '//*[@class="sidebar-elems"]//li' 'Unions' +//@ has - '//*[@class="sidebar-elems"]//li' 'Functions' +//@ has - '//*[@class="sidebar-elems"]//li' 'Traits' +//@ has - '//*[@class="sidebar-elems"]//li' 'Macros' +//@ has - '//*[@class="sidebar-elems"]//li' 'Type Aliases' +//@ has - '//*[@class="sidebar-elems"]//li' 'Constants' +//@ has - '//*[@class="sidebar-elems"]//li' 'Statics' +//@ has - '//*[@class="sidebar-elems"]//li' 'Primitive Types' pub struct Foo; pub enum Enum { diff --git a/tests/rustdoc/sidebar-items.rs b/tests/rustdoc/sidebar-items.rs index b746f698264..f3812143a7d 100644 --- a/tests/rustdoc/sidebar-items.rs +++ b/tests/rustdoc/sidebar-items.rs @@ -1,20 +1,20 @@ #![feature(associated_type_defaults)] #![crate_name = "foo"] -// @has foo/trait.Foo.html -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-methods"]' 'Required Methods' -// @has - '//*[@class="sidebar-elems"]//section//a' 'bar' -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-methods"]' 'Provided Methods' -// @has - '//*[@class="sidebar-elems"]//section//a' 'foo' -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-associated-consts"]' 'Required Associated Constants' -// @has - '//*[@class="sidebar-elems"]//section//a' 'FOO' -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-consts"]' 'Provided Associated Constants' -// @has - '//*[@class="sidebar-elems"]//section//a' 'BAR' -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-associated-types"]' 'Required Associated Types' -// @has - '//*[@class="sidebar-elems"]//section//a' 'Output' -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-types"]' 'Provided Associated Types' -// @has - '//*[@class="sidebar-elems"]//section//a' 'Extra' -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#object-safety"]' 'Object Safety' +//@ has foo/trait.Foo.html +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-methods"]' 'Required Methods' +//@ has - '//*[@class="sidebar-elems"]//section//a' 'bar' +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-methods"]' 'Provided Methods' +//@ has - '//*[@class="sidebar-elems"]//section//a' 'foo' +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-associated-consts"]' 'Required Associated Constants' +//@ has - '//*[@class="sidebar-elems"]//section//a' 'FOO' +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-consts"]' 'Provided Associated Constants' +//@ has - '//*[@class="sidebar-elems"]//section//a' 'BAR' +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-associated-types"]' 'Required Associated Types' +//@ has - '//*[@class="sidebar-elems"]//section//a' 'Output' +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-types"]' 'Provided Associated Types' +//@ has - '//*[@class="sidebar-elems"]//section//a' 'Extra' +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#object-safety"]' 'Object Safety' pub trait Foo { const FOO: usize; const BAR: u32 = 0; @@ -25,37 +25,37 @@ pub trait Foo { fn bar() -> Self::Output; } -// @has foo/trait.Safe.html -// @!has - '//div[@class="sidebar-elems"]//h3/a[@href="#object-safety"]' '' +//@ has foo/trait.Safe.html +//@ !has - '//div[@class="sidebar-elems"]//h3/a[@href="#object-safety"]' '' pub trait Safe { fn access(&self); } -// @has foo/struct.Bar.html -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields' -// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f"]' 'f' -// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.u"]' 'u' -// @!has - '//*[@class="sidebar-elems"]//section//a' 'waza' +//@ has foo/struct.Bar.html +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields' +//@ has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f"]' 'f' +//@ has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.u"]' 'u' +//@ !has - '//*[@class="sidebar-elems"]//section//a' 'waza' pub struct Bar { pub f: u32, pub u: u32, waza: u32, } -// @has foo/enum.En.html -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#variants"]' 'Variants' -// @has - '//*[@class="sidebar-elems"]//section//a' 'Foo' -// @has - '//*[@class="sidebar-elems"]//section//a' 'Bar' +//@ has foo/enum.En.html +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#variants"]' 'Variants' +//@ has - '//*[@class="sidebar-elems"]//section//a' 'Foo' +//@ has - '//*[@class="sidebar-elems"]//section//a' 'Bar' pub enum En { Foo, Bar, } -// @has foo/union.MyUnion.html -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields' -// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f1"]' 'f1' -// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f2"]' 'f2' -// @!has - '//*[@class="sidebar-elems"]//section//a' 'waza' +//@ has foo/union.MyUnion.html +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields' +//@ has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f1"]' 'f1' +//@ has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f2"]' 'f2' +//@ !has - '//*[@class="sidebar-elems"]//section//a' 'waza' pub union MyUnion { pub f1: u32, pub f2: f32, diff --git a/tests/rustdoc/sidebar-link-generation.rs b/tests/rustdoc/sidebar-link-generation.rs index 7858f35a261..ee868ec75d3 100644 --- a/tests/rustdoc/sidebar-link-generation.rs +++ b/tests/rustdoc/sidebar-link-generation.rs @@ -1,6 +1,6 @@ #![crate_name = "foo"] -// @has foo/struct.SomeStruct.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.some_fn-1"]' \ +//@ has foo/struct.SomeStruct.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.some_fn-1"]' \ // "some_fn" pub struct SomeStruct { _inner: T } diff --git a/tests/rustdoc/sidebar-links-to-foreign-impl.rs b/tests/rustdoc/sidebar-links-to-foreign-impl.rs index 733a18ad94a..7c039eeb39f 100644 --- a/tests/rustdoc/sidebar-links-to-foreign-impl.rs +++ b/tests/rustdoc/sidebar-links-to-foreign-impl.rs @@ -2,13 +2,13 @@ #![crate_name = "foo"] -// @has foo/trait.Foo.html -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#foreign-impls"]' 'Implementations on Foreign Types' -// @has - '//h2[@id="foreign-impls"]' 'Implementations on Foreign Types' -// @has - '//*[@class="sidebar-elems"]//section//a[@href="#impl-Foo-for-u32"]' 'u32' -// @has - '//*[@id="impl-Foo-for-u32"]//h3[@class="code-header"]' 'impl Foo for u32' -// @has - "//*[@class=\"sidebar-elems\"]//section//a[@href=\"#impl-Foo-for-%26str\"]" "&'a str" -// @has - "//*[@id=\"impl-Foo-for-%26str\"]//h3[@class=\"code-header\"]" "impl<'a> Foo for &'a str" +//@ has foo/trait.Foo.html +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#foreign-impls"]' 'Implementations on Foreign Types' +//@ has - '//h2[@id="foreign-impls"]' 'Implementations on Foreign Types' +//@ has - '//*[@class="sidebar-elems"]//section//a[@href="#impl-Foo-for-u32"]' 'u32' +//@ has - '//*[@id="impl-Foo-for-u32"]//h3[@class="code-header"]' 'impl Foo for u32' +//@ has - "//*[@class=\"sidebar-elems\"]//section//a[@href=\"#impl-Foo-for-%26str\"]" "&'a str" +//@ has - "//*[@id=\"impl-Foo-for-%26str\"]//h3[@class=\"code-header\"]" "impl<'a> Foo for &'a str" pub trait Foo {} impl Foo for u32 {} diff --git a/tests/rustdoc/sidebar-trait-impl-disambiguate-78701.rs b/tests/rustdoc/sidebar-trait-impl-disambiguate-78701.rs index 89b7ccb5222..b1bf029cf84 100644 --- a/tests/rustdoc/sidebar-trait-impl-disambiguate-78701.rs +++ b/tests/rustdoc/sidebar-trait-impl-disambiguate-78701.rs @@ -5,9 +5,9 @@ // link to the blanket impl and not the other impl. Basically, we're checking if // the ID is correctly derived. -// @has 'foo/struct.AnotherStruct.html' -// @count - '//*[@class="sidebar"]//a[@href="#impl-AnAmazingTrait-for-AnotherStruct%3C()%3E"]' 1 -// @count - '//*[@class="sidebar"]//a[@href="#impl-AnAmazingTrait-for-T"]' 1 +//@ has 'foo/struct.AnotherStruct.html' +//@ count - '//*[@class="sidebar"]//a[@href="#impl-AnAmazingTrait-for-AnotherStruct%3C()%3E"]' 1 +//@ count - '//*[@class="sidebar"]//a[@href="#impl-AnAmazingTrait-for-T"]' 1 pub trait Something {} diff --git a/tests/rustdoc/sized_trait.rs b/tests/rustdoc/sized_trait.rs index feef4de8d57..4df62fdc081 100644 --- a/tests/rustdoc/sized_trait.rs +++ b/tests/rustdoc/sized_trait.rs @@ -1,17 +1,17 @@ #![crate_name = "foo"] -// @has foo/struct.Bar.html -// @!has - '//*[@id="impl-Sized"]' '' +//@ has foo/struct.Bar.html +//@ !has - '//*[@id="impl-Sized"]' '' pub struct Bar { a: u16, } -// @has foo/struct.Foo.html -// @!has - '//*[@id="impl-Sized"]' '' +//@ has foo/struct.Foo.html +//@ !has - '//*[@id="impl-Sized"]' '' pub struct Foo(T); -// @has foo/struct.Unsized.html -// @has - '//*[@id="impl-Sized-for-Unsized"]//h3[@class="code-header"]' 'impl !Sized for Unsized' +//@ has foo/struct.Unsized.html +//@ has - '//*[@id="impl-Sized-for-Unsized"]//h3[@class="code-header"]' 'impl !Sized for Unsized' pub struct Unsized { data: [u8], } diff --git a/tests/rustdoc/slice-links.rs b/tests/rustdoc/slice-links.rs index 6dea3b74ea3..74f260976c0 100644 --- a/tests/rustdoc/slice-links.rs +++ b/tests/rustdoc/slice-links.rs @@ -3,26 +3,26 @@ pub struct MyBox(*const T); -// @has 'foo/fn.alpha.html' -// @snapshot link_slice_u32 - '//pre[@class="rust item-decl"]/code' +//@ has 'foo/fn.alpha.html' +//@ snapshot link_slice_u32 - '//pre[@class="rust item-decl"]/code' pub fn alpha() -> &'static [u32] { loop {} } -// @has 'foo/fn.beta.html' -// @snapshot link_slice_generic - '//pre[@class="rust item-decl"]/code' +//@ has 'foo/fn.beta.html' +//@ snapshot link_slice_generic - '//pre[@class="rust item-decl"]/code' pub fn beta() -> &'static [T] { loop {} } -// @has 'foo/fn.gamma.html' -// @snapshot link_box_u32 - '//pre[@class="rust item-decl"]/code' +//@ has 'foo/fn.gamma.html' +//@ snapshot link_box_u32 - '//pre[@class="rust item-decl"]/code' pub fn gamma() -> MyBox<[u32]> { loop {} } -// @has 'foo/fn.delta.html' -// @snapshot link_box_generic - '//pre[@class="rust item-decl"]/code' +//@ has 'foo/fn.delta.html' +//@ snapshot link_box_generic - '//pre[@class="rust item-decl"]/code' pub fn delta() -> MyBox<[T]> { loop {} } diff --git a/tests/rustdoc/smart-punct.rs b/tests/rustdoc/smart-punct.rs index 7ae5bd69945..41b3ee3f14e 100644 --- a/tests/rustdoc/smart-punct.rs +++ b/tests/rustdoc/smart-punct.rs @@ -20,9 +20,9 @@ //! I say "don't smart-punct me -- please!" //! ``` -// @has "foo/index.html" "//p" "This is the “start” of the ‘document’! How’d you know that “it’s” the start?" -// @has "foo/index.html" "//h2" "Header with “smart punct’”" -// @has "foo/index.html" '//a[@href="https://www.rust-lang.org"]' "link with “smart punct’” – yessiree!" -// @has "foo/index.html" '//code' "this inline code -- it shouldn't have \"smart punct\"" -// @has "foo/index.html" '//pre' "let x = \"don't smart-punct me -- please!\";" -// @has "foo/index.html" '//pre' "I say \"don't smart-punct me -- please!\"" +//@ has "foo/index.html" "//p" "This is the “start” of the ‘document’! How’d you know that “it’s” the start?" +//@ has "foo/index.html" "//h2" "Header with “smart punct’”" +//@ has "foo/index.html" '//a[@href="https://www.rust-lang.org"]' "link with “smart punct’” – yessiree!" +//@ has "foo/index.html" '//code' "this inline code -- it shouldn't have \"smart punct\"" +//@ has "foo/index.html" '//pre' "let x = \"don't smart-punct me -- please!\";" +//@ has "foo/index.html" '//pre' "I say \"don't smart-punct me -- please!\"" diff --git a/tests/rustdoc/smoke.rs b/tests/rustdoc/smoke.rs index c1ed3a0c953..415fca313fc 100644 --- a/tests/rustdoc/smoke.rs +++ b/tests/rustdoc/smoke.rs @@ -1,25 +1,25 @@ -// @has smoke/index.html +//@ has smoke/index.html //! Very docs -// @has smoke/bar/index.html +//@ has smoke/bar/index.html pub mod bar { /// So correct - // @has smoke/bar/baz/index.html + //@ has smoke/bar/baz/index.html pub mod baz { /// Much detail - // @has smoke/bar/baz/fn.baz.html + //@ has smoke/bar/baz/fn.baz.html pub fn baz() { } } /// *wow* - // @has smoke/bar/trait.Doge.html + //@ has smoke/bar/trait.Doge.html pub trait Doge { fn dummy(&self) { } } - // @has smoke/bar/struct.Foo.html + //@ has smoke/bar/struct.Foo.html pub struct Foo { x: isize, y: usize } - // @has smoke/bar/fn.prawns.html + //@ has smoke/bar/fn.prawns.html pub fn prawns((a, b): (isize, usize), Foo { x, y }: Foo) { } } diff --git a/tests/rustdoc/sort-53812.rs b/tests/rustdoc/sort-53812.rs index 968ae035043..21cb0ad9308 100644 --- a/tests/rustdoc/sort-53812.rs +++ b/tests/rustdoc/sort-53812.rs @@ -14,10 +14,10 @@ macro_rules! array_impls { } } -// @has foo/trait.MyIterator.html -// @has - '//*[@id="implementors-list"]/*[@class="impl"][1]' 'MyStruct<[T; 0]>' -// @has - '//*[@id="implementors-list"]/*[@class="impl"][2]' 'MyStruct<[T; 1]>' -// @has - '//*[@id="implementors-list"]/*[@class="impl"][3]' 'MyStruct<[T; 2]>' -// @has - '//*[@id="implementors-list"]/*[@class="impl"][4]' 'MyStruct<[T; 3]>' -// @has - '//*[@id="implementors-list"]/*[@class="impl"][5]' 'MyStruct<[T; 10]>' +//@ has foo/trait.MyIterator.html +//@ has - '//*[@id="implementors-list"]/*[@class="impl"][1]' 'MyStruct<[T; 0]>' +//@ has - '//*[@id="implementors-list"]/*[@class="impl"][2]' 'MyStruct<[T; 1]>' +//@ has - '//*[@id="implementors-list"]/*[@class="impl"][3]' 'MyStruct<[T; 2]>' +//@ has - '//*[@id="implementors-list"]/*[@class="impl"][4]' 'MyStruct<[T; 3]>' +//@ has - '//*[@id="implementors-list"]/*[@class="impl"][5]' 'MyStruct<[T; 10]>' array_impls! { 10 3 2 1 0 } diff --git a/tests/rustdoc/sort-modules-by-appearance.rs b/tests/rustdoc/sort-modules-by-appearance.rs index 2d224107d22..1254116afdf 100644 --- a/tests/rustdoc/sort-modules-by-appearance.rs +++ b/tests/rustdoc/sort-modules-by-appearance.rs @@ -9,5 +9,5 @@ pub mod module_c {} pub mod module_a {} -// @matchesraw 'sort_modules_by_appearance/index.html' '(?s)module_b.*module_c.*module_a' -// @matchesraw 'sort_modules_by_appearance/sidebar-items.js' '"module_b".*"module_c".*"module_a"' +//@ matchesraw 'sort_modules_by_appearance/index.html' '(?s)module_b.*module_c.*module_a' +//@ matchesraw 'sort_modules_by_appearance/sidebar-items.js' '"module_b".*"module_c".*"module_a"' diff --git a/tests/rustdoc/source-code-highlight.rs b/tests/rustdoc/source-code-highlight.rs index 0a1be791ec2..f1c905e64c0 100644 --- a/tests/rustdoc/source-code-highlight.rs +++ b/tests/rustdoc/source-code-highlight.rs @@ -4,26 +4,26 @@ //@ compile-flags: -Zunstable-options --generate-link-to-definition #![crate_name = "foo"] -// @has 'src/foo/source-code-highlight.rs.html' +//@ has 'src/foo/source-code-highlight.rs.html' -// @hasraw - 'foo' +//@ hasraw - 'foo' #[macro_export] macro_rules! foo { () => {} } -// @hasraw - 'foo!' +//@ hasraw - 'foo!' foo! {} -// @hasraw - 'f' +//@ hasraw - 'f' #[rustfmt::skip] pub fn f () {} -// @hasraw - 'Bar' -// @hasraw - 'Bar' -// @hasraw - 'u32' +//@ hasraw - 'Bar' +//@ hasraw - 'Bar' +//@ hasraw - 'u32' #[rustfmt::skip] pub struct Bar ( u32 ); -// @hasraw - 'Foo' +//@ hasraw - 'Foo' pub enum Foo { A, } diff --git a/tests/rustdoc/source-file.rs b/tests/rustdoc/source-file.rs index 16d4cbe3a34..6cff5edf146 100644 --- a/tests/rustdoc/source-file.rs +++ b/tests/rustdoc/source-file.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -// @hasraw src-files.js source-file.rs +//@ hasraw src-files.js source-file.rs pub struct Foo; diff --git a/tests/rustdoc/source-version-separator.rs b/tests/rustdoc/source-version-separator.rs index 7256f731573..a998c538eed 100644 --- a/tests/rustdoc/source-version-separator.rs +++ b/tests/rustdoc/source-version-separator.rs @@ -2,24 +2,24 @@ #![crate_name = "foo"] #![feature(staged_api)] -// @has foo/trait.Bar.html -// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' +//@ has foo/trait.Bar.html +//@ has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' #[stable(feature = "bar", since = "1.0")] pub trait Bar { - // @has - '//*[@id="tymethod.foo"]/*[@class="rightside"]' '3.0.0 · source' + //@ has - '//*[@id="tymethod.foo"]/*[@class="rightside"]' '3.0.0 · source' #[stable(feature = "foobar", since = "3.0")] fn foo(); } -// @has - '//div[@id="implementors-list"]//*[@class="rightside"]' '4.0.0 · source' +//@ has - '//div[@id="implementors-list"]//*[@class="rightside"]' '4.0.0 · source' -// @has foo/struct.Foo.html -// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' +//@ has foo/struct.Foo.html +//@ has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' #[stable(feature = "baz", since = "1.0")] pub struct Foo; impl Foo { - // @has - '//*[@id="method.foofoo"]/*[@class="rightside"]' '3.0.0 · source' + //@ has - '//*[@id="method.foofoo"]/*[@class="rightside"]' '3.0.0 · source' #[stable(feature = "foobar", since = "3.0")] pub fn foofoo() {} } diff --git a/tests/rustdoc/src-link-external-macro-26606.rs b/tests/rustdoc/src-link-external-macro-26606.rs index a5b34867869..b5662be9b2d 100644 --- a/tests/rustdoc/src-link-external-macro-26606.rs +++ b/tests/rustdoc/src-link-external-macro-26606.rs @@ -5,10 +5,10 @@ // https://github.com/rust-lang/rust/issues/26606 #![crate_name="issue_26606"] -// @has issue_26606_macro/macro.make_item.html +//@ has issue_26606_macro/macro.make_item.html #[macro_use] extern crate issue_26606_macro; -// @has issue_26606/constant.FOO.html -// @has - '//a[@href="../src/issue_26606/src-link-external-macro-26606.rs.html#14"]' 'source' +//@ has issue_26606/constant.FOO.html +//@ has - '//a[@href="../src/issue_26606/src-link-external-macro-26606.rs.html#14"]' 'source' make_item!(FOO); diff --git a/tests/rustdoc/src-links-auto-impls.rs b/tests/rustdoc/src-links-auto-impls.rs index 08a497d4cf5..dd07f85eee7 100644 --- a/tests/rustdoc/src-links-auto-impls.rs +++ b/tests/rustdoc/src-links-auto-impls.rs @@ -1,12 +1,12 @@ #![crate_name = "foo"] -// @has foo/struct.Unsized.html -// @has - '//*[@id="impl-Sized-for-Unsized"]/h3[@class="code-header"]' 'impl !Sized for Unsized' -// @!has - '//*[@id="impl-Sized-for-Unsized"]//a[@class="src"]' 'source' -// @has - '//*[@id="impl-Sync-for-Unsized"]/h3[@class="code-header"]' 'impl Sync for Unsized' -// @!has - '//*[@id="impl-Sync-for-Unsized"]//a[@class="src"]' 'source' -// @has - '//*[@id="impl-Any-for-T"]/h3[@class="code-header"]' 'impl Any for T' -// @has - '//*[@id="impl-Any-for-T"]//a[@class="src rightside"]' 'source' +//@ has foo/struct.Unsized.html +//@ has - '//*[@id="impl-Sized-for-Unsized"]/h3[@class="code-header"]' 'impl !Sized for Unsized' +//@ !has - '//*[@id="impl-Sized-for-Unsized"]//a[@class="src"]' 'source' +//@ has - '//*[@id="impl-Sync-for-Unsized"]/h3[@class="code-header"]' 'impl Sync for Unsized' +//@ !has - '//*[@id="impl-Sync-for-Unsized"]//a[@class="src"]' 'source' +//@ has - '//*[@id="impl-Any-for-T"]/h3[@class="code-header"]' 'impl Any for T' +//@ has - '//*[@id="impl-Any-for-T"]//a[@class="src rightside"]' 'source' pub struct Unsized { data: [u8], } diff --git a/tests/rustdoc/src-links-external.rs b/tests/rustdoc/src-links-external.rs index fd48b964ab9..e8acbf1b9b4 100644 --- a/tests/rustdoc/src-links-external.rs +++ b/tests/rustdoc/src-links-external.rs @@ -6,8 +6,8 @@ extern crate src_links_external; -// @has foo/bar/index.html '//a/@href' '../../src/src_links_external/src-links-external.rs.html#1' +//@ has foo/bar/index.html '//a/@href' '../../src/src_links_external/src-links-external.rs.html#1' #[doc(inline)] pub use src_links_external as bar; -// @has foo/bar/struct.Foo.html '//a/@href' '../../src/src_links_external/src-links-external.rs.html#1' +//@ has foo/bar/struct.Foo.html '//a/@href' '../../src/src_links_external/src-links-external.rs.html#1' diff --git a/tests/rustdoc/src-links-implementor-43893.rs b/tests/rustdoc/src-links-implementor-43893.rs index 811957c430b..d9abdcde08d 100644 --- a/tests/rustdoc/src-links-implementor-43893.rs +++ b/tests/rustdoc/src-links-implementor-43893.rs @@ -7,15 +7,15 @@ pub trait SomeTrait {} pub struct SomeStruct; -// @has foo/trait.SomeTrait.html '//a/@href' '../src/foo/src-links-implementor-43893.rs.html#11' +//@ has foo/trait.SomeTrait.html '//a/@href' '../src/foo/src-links-implementor-43893.rs.html#11' impl SomeTrait for usize {} -// @has foo/trait.SomeTrait.html '//a/@href' '../src/foo/src-links-implementor-43893.rs.html#14-16' +//@ has foo/trait.SomeTrait.html '//a/@href' '../src/foo/src-links-implementor-43893.rs.html#14-16' impl SomeTrait for SomeStruct { // deliberately multi-line impl } pub trait AnotherTrait {} -// @has foo/trait.AnotherTrait.html '//a/@href' '../src/foo/src-links-implementor-43893.rs.html#21' +//@ has foo/trait.AnotherTrait.html '//a/@href' '../src/foo/src-links-implementor-43893.rs.html#21' impl AnotherTrait for T {} diff --git a/tests/rustdoc/src-links-inlined-34274.rs b/tests/rustdoc/src-links-inlined-34274.rs index 6d6999cf866..8675ae4736e 100644 --- a/tests/rustdoc/src-links-inlined-34274.rs +++ b/tests/rustdoc/src-links-inlined-34274.rs @@ -7,5 +7,5 @@ extern crate issue_34274; -// @has foo/fn.extern_c_fn.html '//a/@href' '../src/issue_34274/issue-34274.rs.html#2' +//@ has foo/fn.extern_c_fn.html '//a/@href' '../src/issue_34274/issue-34274.rs.html#2' pub use issue_34274::extern_c_fn; diff --git a/tests/rustdoc/src-links.rs b/tests/rustdoc/src-links.rs index 7a6c733d464..24039a5d84e 100644 --- a/tests/rustdoc/src-links.rs +++ b/tests/rustdoc/src-links.rs @@ -1,51 +1,51 @@ #![crate_name = "foo"] //! Dox -// @has src/foo/src-links.rs.html -// @has foo/index.html '//a/@href' '../src/foo/src-links.rs.html' +//@ has src/foo/src-links.rs.html +//@ has foo/index.html '//a/@href' '../src/foo/src-links.rs.html' #[path = "src-links/mod.rs"] pub mod qux; -// @has src/foo/src-links.rs.html -// @has foo/fizz/index.html '//a/@href' '../src/foo/src-links/fizz.rs.html' +//@ has src/foo/src-links.rs.html +//@ has foo/fizz/index.html '//a/@href' '../src/foo/src-links/fizz.rs.html' #[path = "src-links/../src-links/fizz.rs"] pub mod fizz; -// @has foo/bar/index.html '//a/@href' '../../src/foo/src-links.rs.html' +//@ has foo/bar/index.html '//a/@href' '../../src/foo/src-links.rs.html' pub mod bar { /// Dox - // @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html' + //@ has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html' pub mod baz { /// Dox - // @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html' + //@ has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html' pub fn baz() { } } /// Dox - // @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html' + //@ has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html' pub trait Foobar { fn dummy(&self) { } } - // @has foo/bar/struct.Foo.html '//a/@href' '../../src/foo/src-links.rs.html' + //@ has foo/bar/struct.Foo.html '//a/@href' '../../src/foo/src-links.rs.html' pub struct Foo { x: i32, y: u32 } - // @has foo/bar/fn.prawns.html '//a/@href' '../../src/foo/src-links.rs.html' + //@ has foo/bar/fn.prawns.html '//a/@href' '../../src/foo/src-links.rs.html' pub fn prawns((a, b): (i32, u32), Foo { x, y }: Foo) { } } /// Dox -// @has foo/fn.modfn.html '//a/@href' '../src/foo/src-links.rs.html' +//@ has foo/fn.modfn.html '//a/@href' '../src/foo/src-links.rs.html' pub fn modfn() { } // same hierarchy as above, but just for the submodule -// @has src/foo/src-links/mod.rs.html -// @has foo/qux/index.html '//a/@href' '../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/index.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/baz/index.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/baz/fn.baz.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/trait.Foobar.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/struct.Foo.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/bar/fn.prawns.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' -// @has foo/qux/fn.modfn.html '//a/@href' '../../src/foo/src-links/mod.rs.html' +//@ has src/foo/src-links/mod.rs.html +//@ has foo/qux/index.html '//a/@href' '../../src/foo/src-links/mod.rs.html' +//@ has foo/qux/bar/index.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' +//@ has foo/qux/bar/baz/index.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html' +//@ has foo/qux/bar/baz/fn.baz.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html' +//@ has foo/qux/bar/trait.Foobar.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' +//@ has foo/qux/bar/struct.Foo.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' +//@ has foo/qux/bar/fn.prawns.html '//a/@href' '../../../src/foo/src-links/mod.rs.html' +//@ has foo/qux/fn.modfn.html '//a/@href' '../../src/foo/src-links/mod.rs.html' diff --git a/tests/rustdoc/src-mod-path-absolute-26995.rs b/tests/rustdoc/src-mod-path-absolute-26995.rs index 47045503bb9..f754b64977f 100644 --- a/tests/rustdoc/src-mod-path-absolute-26995.rs +++ b/tests/rustdoc/src-mod-path-absolute-26995.rs @@ -4,7 +4,7 @@ // https://github.com/rust-lang/rust/issues/26995 #![crate_name="issue_26995"] -// @has src/issue_26995/dev/null.html -// @has issue_26995/null/index.html '//a/@href' '../../src/issue_26995/dev/null.html' +//@ has src/issue_26995/dev/null.html +//@ has issue_26995/null/index.html '//a/@href' '../../src/issue_26995/dev/null.html' #[path="/dev/null"] pub mod null; diff --git a/tests/rustdoc/stability.rs b/tests/rustdoc/stability.rs index c4d7118d07f..270da822c00 100644 --- a/tests/rustdoc/stability.rs +++ b/tests/rustdoc/stability.rs @@ -2,19 +2,19 @@ #![unstable(feature = "test", issue = "none")] -// @has stability/index.html -// @has - '//ul[@class="item-table"]/li[1]//a' AaStable -// @has - '//ul[@class="item-table"]/li[2]//a' ZzStable -// @has - '//ul[@class="item-table"]/li[3]//a' Unstable +//@ has stability/index.html +//@ has - '//ul[@class="item-table"]/li[1]//a' AaStable +//@ has - '//ul[@class="item-table"]/li[2]//a' ZzStable +//@ has - '//ul[@class="item-table"]/li[3]//a' Unstable #[stable(feature = "rust2", since = "2.2.2")] pub struct AaStable; pub struct Unstable { - // @has stability/struct.Unstable.html \ + //@ has stability/struct.Unstable.html \ // '//span[@class="item-info"]//div[@class="stab unstable"]' \ // 'This is a nightly-only experimental API' - // @count stability/struct.Unstable.html '//span[@class="stab unstable"]' 0 + //@ count stability/struct.Unstable.html '//span[@class="stab unstable"]' 0 pub foo: u32, pub bar: u32, } diff --git a/tests/rustdoc/staged-api-deprecated-unstable-32374.rs b/tests/rustdoc/staged-api-deprecated-unstable-32374.rs index d282dea907e..556b6fb61ac 100644 --- a/tests/rustdoc/staged-api-deprecated-unstable-32374.rs +++ b/tests/rustdoc/staged-api-deprecated-unstable-32374.rs @@ -4,29 +4,29 @@ #![unstable(feature = "test", issue = "32374")] #![crate_name="issue_32374"] -// @matches issue_32374/index.html '//*[@class="item-name"]/span[@class="stab deprecated"]' \ +//@ matches issue_32374/index.html '//*[@class="item-name"]/span[@class="stab deprecated"]' \ // 'Deprecated' -// @matches issue_32374/index.html '//*[@class="item-name"]/span[@class="stab unstable"]' \ +//@ matches issue_32374/index.html '//*[@class="item-name"]/span[@class="stab unstable"]' \ // 'Experimental' -// @matches issue_32374/index.html '//*[@class="desc docblock-short"]/text()' 'Docs' +//@ matches issue_32374/index.html '//*[@class="desc docblock-short"]/text()' 'Docs' -// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]/span' '👎' -// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]/span' \ +//@ has issue_32374/struct.T.html '//*[@class="stab deprecated"]/span' '👎' +//@ has issue_32374/struct.T.html '//*[@class="stab deprecated"]/span' \ // 'Deprecated since 1.0.0: text' -// @hasraw - 'test #32374' -// @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' '🔬' -// @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' \ +//@ hasraw - 'test #32374' +//@ matches issue_32374/struct.T.html '//*[@class="stab unstable"]' '🔬' +//@ matches issue_32374/struct.T.html '//*[@class="stab unstable"]' \ // 'This is a nightly-only experimental API. \(test\s#32374\)$' /// Docs #[deprecated(since = "1.0.0", note = "text")] #[unstable(feature = "test", issue = "32374")] pub struct T; -// @has issue_32374/struct.U.html '//*[@class="stab deprecated"]' '👎' -// @has issue_32374/struct.U.html '//*[@class="stab deprecated"]' \ +//@ has issue_32374/struct.U.html '//*[@class="stab deprecated"]' '👎' +//@ has issue_32374/struct.U.html '//*[@class="stab deprecated"]' \ // 'Deprecated since 1.0.0: deprecated' -// @has issue_32374/struct.U.html '//*[@class="stab unstable"]' '🔬' -// @has issue_32374/struct.U.html '//*[@class="stab unstable"]' \ +//@ has issue_32374/struct.U.html '//*[@class="stab unstable"]' '🔬' +//@ has issue_32374/struct.U.html '//*[@class="stab unstable"]' \ // 'This is a nightly-only experimental API. (test #32374)' #[deprecated(since = "1.0.0", note = "deprecated")] #[unstable(feature = "test", issue = "32374", reason = "unstable")] diff --git a/tests/rustdoc/staged-api-feature-issue-27759.rs b/tests/rustdoc/staged-api-feature-issue-27759.rs index 56a45a600da..32e5c495846 100644 --- a/tests/rustdoc/staged-api-feature-issue-27759.rs +++ b/tests/rustdoc/staged-api-feature-issue-27759.rs @@ -6,12 +6,12 @@ #![unstable(feature="test", issue="27759")] -// @has issue_27759/unstable/index.html -// @hasraw - 'test #27759' +//@ has issue_27759/unstable/index.html +//@ hasraw - 'test #27759' #[unstable(feature="test", issue="27759")] pub mod unstable { - // @has issue_27759/unstable/fn.issue.html - // @hasraw - 'test_function #12345' + //@ has issue_27759/unstable/fn.issue.html + //@ hasraw - 'test_function #12345' #[unstable(feature="test_function", issue="12345")] pub fn issue() {} } diff --git a/tests/rustdoc/static-root-path.rs b/tests/rustdoc/static-root-path.rs index e101d152fee..1bca4e40f44 100644 --- a/tests/rustdoc/static-root-path.rs +++ b/tests/rustdoc/static-root-path.rs @@ -1,18 +1,18 @@ //@ compile-flags:-Z unstable-options --static-root-path /cache/ -// @has static_root_path/struct.SomeStruct.html -// @matchesraw - '"/cache/main-' -// @!matchesraw - '"\.\./main' -// @matchesraw - 'data-root-path="\.\./"' -// @!matchesraw - '"/cache/search-index\.js"' +//@ has static_root_path/struct.SomeStruct.html +//@ matchesraw - '"/cache/main-' +//@ !matchesraw - '"\.\./main' +//@ matchesraw - 'data-root-path="\.\./"' +//@ !matchesraw - '"/cache/search-index\.js"' pub struct SomeStruct; -// @has src/static_root_path/static-root-path.rs.html -// @matchesraw - '"/cache/src-script-' -// @!matchesraw - '"\.\./\.\./src-script' -// @matchesraw - '"\.\./\.\./src-files.js"' -// @!matchesraw - '"/cache/src-files\.js"' +//@ has src/static_root_path/static-root-path.rs.html +//@ matchesraw - '"/cache/src-script-' +//@ !matchesraw - '"\.\./\.\./src-script' +//@ matchesraw - '"\.\./\.\./src-files.js"' +//@ !matchesraw - '"/cache/src-files\.js"' -// @has settings.html -// @matchesraw - '/cache/settings-' -// @!matchesraw - '\../settings' +//@ has settings.html +//@ matchesraw - '/cache/settings-' +//@ !matchesraw - '\../settings' diff --git a/tests/rustdoc/static.rs b/tests/rustdoc/static.rs index d127f0c5829..b777aa945ff 100644 --- a/tests/rustdoc/static.rs +++ b/tests/rustdoc/static.rs @@ -2,11 +2,11 @@ #![crate_type = "lib"] -// @has static/static.FOO.html '//pre' 'static FOO: usize' +//@ has static/static.FOO.html '//pre' 'static FOO: usize' static FOO: usize = 1; -// @has static/static.BAR.html '//pre' 'pub static BAR: usize' +//@ has static/static.BAR.html '//pre' 'pub static BAR: usize' pub static BAR: usize = 1; -// @has static/static.BAZ.html '//pre' 'pub static mut BAZ: usize' +//@ has static/static.BAZ.html '//pre' 'pub static mut BAZ: usize' pub static mut BAZ: usize = 1; diff --git a/tests/rustdoc/strip-block-doc-comments-stars.rs b/tests/rustdoc/strip-block-doc-comments-stars.rs index ca4c93f92e0..329e760b43e 100644 --- a/tests/rustdoc/strip-block-doc-comments-stars.rs +++ b/tests/rustdoc/strip-block-doc-comments-stars.rs @@ -3,8 +3,8 @@ // The goal of this test is to ensure that it won't be generated as a list because // block doc comments can have their lines starting with a star. -// @has foo/fn.foo.html -// @snapshot docblock - '//*[@class="toggle top-doc"]//*[@class="docblock"]' +//@ has foo/fn.foo.html +//@ snapshot docblock - '//*[@class="toggle top-doc"]//*[@class="docblock"]' /** * a */ diff --git a/tests/rustdoc/strip-enum-variant.rs b/tests/rustdoc/strip-enum-variant.rs index 2512fa34b39..9874588ef59 100644 --- a/tests/rustdoc/strip-enum-variant.rs +++ b/tests/rustdoc/strip-enum-variant.rs @@ -1,9 +1,9 @@ -// @has strip_enum_variant/enum.MyThing.html -// @has - '//code' 'Shown' -// @!has - '//code' 'NotShown' -// @has - '//code' '// some variants omitted' +//@ has strip_enum_variant/enum.MyThing.html +//@ has - '//code' 'Shown' +//@ !has - '//code' 'NotShown' +//@ has - '//code' '// some variants omitted' // Also check that `NotShown` isn't displayed in the sidebar. -// @snapshot no-not-shown - '//*[@class="sidebar-elems"]/section/*[@class="block variant"]' +//@ snapshot no-not-shown - '//*[@class="sidebar-elems"]/section/*[@class="block variant"]' pub enum MyThing { Shown, #[doc(hidden)] diff --git a/tests/rustdoc/strip-priv-imports-pass-27104.rs b/tests/rustdoc/strip-priv-imports-pass-27104.rs index b7198e82a03..ad6b66dbc81 100644 --- a/tests/rustdoc/strip-priv-imports-pass-27104.rs +++ b/tests/rustdoc/strip-priv-imports-pass-27104.rs @@ -5,9 +5,9 @@ // https://github.com/rust-lang/rust/issues/27104 #![crate_name="issue_27104"] -// @has issue_27104/index.html -// @!hasraw - 'extern crate std' -// @!hasraw - 'use std::prelude::' +//@ has issue_27104/index.html +//@ !hasraw - 'extern crate std' +//@ !hasraw - 'use std::prelude::' -// @hasraw - 'pub extern crate empty' +//@ hasraw - 'pub extern crate empty' pub extern crate empty; diff --git a/tests/rustdoc/struct-arg-pattern.rs b/tests/rustdoc/struct-arg-pattern.rs index 6f06c8c9c49..af94089bf1a 100644 --- a/tests/rustdoc/struct-arg-pattern.rs +++ b/tests/rustdoc/struct-arg-pattern.rs @@ -4,7 +4,7 @@ struct BodyId { hir_id: usize, } -// @has 'foo/fn.body_owner.html' '//pre[@class="rust item-decl"]' 'pub fn body_owner(_: BodyId)' +//@ has 'foo/fn.body_owner.html' '//pre[@class="rust item-decl"]' 'pub fn body_owner(_: BodyId)' pub fn body_owner(BodyId { hir_id }: BodyId) { // ... } diff --git a/tests/rustdoc/struct-field.rs b/tests/rustdoc/struct-field.rs index 998683bdde7..c04fcb344a1 100644 --- a/tests/rustdoc/struct-field.rs +++ b/tests/rustdoc/struct-field.rs @@ -1,9 +1,9 @@ #![crate_name = "foo"] -// @has foo/index.html '//*[@class="docblock"]/p/a[@href="struct.Foo.html#structfield.bar"]' 'Foo::bar' -// @has foo/index.html '//*[@class="docblock"]/p/a[@href="union.Bar.html#structfield.foo"]' 'Bar::foo' -// @has foo/index.html '//*[@class="docblock"]/p/a[@href="enum.Uniooon.html#variant.X"]' 'Uniooon::X' +//@ has foo/index.html '//*[@class="docblock"]/p/a[@href="struct.Foo.html#structfield.bar"]' 'Foo::bar' +//@ has foo/index.html '//*[@class="docblock"]/p/a[@href="union.Bar.html#structfield.foo"]' 'Bar::foo' +//@ has foo/index.html '//*[@class="docblock"]/p/a[@href="enum.Uniooon.html#variant.X"]' 'Uniooon::X' //! Test with [Foo::bar], [Bar::foo], [Uniooon::X] diff --git a/tests/rustdoc/struct-implementations-title.rs b/tests/rustdoc/struct-implementations-title.rs index 5468796f669..ca5b5c0ee20 100644 --- a/tests/rustdoc/struct-implementations-title.rs +++ b/tests/rustdoc/struct-implementations-title.rs @@ -2,8 +2,8 @@ pub struct Struc; -// @has foo/struct.Struc.html -// @has - '//*[@id="main-content"]/h2[@id="implementations"]' "Implementations" +//@ has foo/struct.Struc.html +//@ has - '//*[@id="main-content"]/h2[@id="implementations"]' "Implementations" impl Struc { pub const S: u64 = 0; } diff --git a/tests/rustdoc/structfields.rs b/tests/rustdoc/structfields.rs index 7e1cada4b98..b7644f3bb59 100644 --- a/tests/rustdoc/structfields.rs +++ b/tests/rustdoc/structfields.rs @@ -1,44 +1,44 @@ -// @has structfields/struct.Foo.html +//@ has structfields/struct.Foo.html pub struct Foo { - // @has - //pre "pub a: ()" + //@ has - //pre "pub a: ()" pub a: (), - // @has - //pre "/* private fields */" - // @!has - //pre "b: ()" + //@ has - //pre "/* private fields */" + //@ !has - //pre "b: ()" b: (), - // @!has - //pre "c: usize" + //@ !has - //pre "c: usize" #[doc(hidden)] c: usize, - // @has - //pre "pub d: usize" + //@ has - //pre "pub d: usize" pub d: usize, } -// @has structfields/struct.Bar.html +//@ has structfields/struct.Bar.html pub struct Bar { - // @has - //pre "pub a: ()" + //@ has - //pre "pub a: ()" pub a: (), - // @!has - //pre "/* private fields */" + //@ !has - //pre "/* private fields */" } -// @has structfields/enum.Qux.html +//@ has structfields/enum.Qux.html pub enum Qux { Quz { - // @has - //pre "a: ()" + //@ has - //pre "a: ()" a: (), - // @!has - //pre "b: ()" + //@ !has - //pre "b: ()" #[doc(hidden)] b: (), - // @has - //pre "c: usize" + //@ has - //pre "c: usize" c: usize, - // @has - //pre "/* private fields */" + //@ has - //pre "/* private fields */" }, } -// @has structfields/struct.Baz.html //pre "pub struct Baz { /* private fields */ }" +//@ has structfields/struct.Baz.html //pre "pub struct Baz { /* private fields */ }" pub struct Baz { x: u8, #[doc(hidden)] pub y: u8, } -// @has structfields/struct.Quux.html //pre "pub struct Quux {}" +//@ has structfields/struct.Quux.html //pre "pub struct Quux {}" pub struct Quux {} diff --git a/tests/rustdoc/summary-codeblock-31899.rs b/tests/rustdoc/summary-codeblock-31899.rs index c1b33058c9e..9cbf6492610 100644 --- a/tests/rustdoc/summary-codeblock-31899.rs +++ b/tests/rustdoc/summary-codeblock-31899.rs @@ -1,11 +1,11 @@ // https://github.com/rust-lang/rust/issues/31899 #![crate_name="issue_31899"] -// @has issue_31899/index.html -// @hasraw - 'Make this line a bit longer.' -// @!hasraw - 'rust rust-example-rendered' -// @!hasraw - 'use ndarray::arr2' -// @!hasraw - 'prohibited' +//@ has issue_31899/index.html +//@ hasraw - 'Make this line a bit longer.' +//@ !hasraw - 'rust rust-example-rendered' +//@ !hasraw - 'use ndarray::arr2' +//@ !hasraw - 'prohibited' /// A tuple or fixed size array that can be used to index an array. /// Make this line a bit longer. diff --git a/tests/rustdoc/summary-header-46377.rs b/tests/rustdoc/summary-header-46377.rs index aec74f493d4..11445f0dad6 100644 --- a/tests/rustdoc/summary-header-46377.rs +++ b/tests/rustdoc/summary-header-46377.rs @@ -1,6 +1,6 @@ // https://github.com/rust-lang/rust/issues/46377 #![crate_name="foo"] -// @has 'foo/index.html' '//*[@class="desc docblock-short"]' 'Check out this struct!' +//@ has 'foo/index.html' '//*[@class="desc docblock-short"]' 'Check out this struct!' /// # Check out this struct! pub struct SomeStruct; diff --git a/tests/rustdoc/summary-reference-link-30366.rs b/tests/rustdoc/summary-reference-link-30366.rs index 5b9854c5390..b406946ccfb 100644 --- a/tests/rustdoc/summary-reference-link-30366.rs +++ b/tests/rustdoc/summary-reference-link-30366.rs @@ -1,4 +1,4 @@ -// @has issue_30366/index.html '//a/@href' 'http://www.rust-lang.org/' +//@ has issue_30366/index.html '//a/@href' 'http://www.rust-lang.org/' // https://github.com/rust-lang/rust/issues/30366 #![crate_name="issue_30366"] diff --git a/tests/rustdoc/synthetic_auto/auto-trait-lifetimes-56822.rs b/tests/rustdoc/synthetic_auto/auto-trait-lifetimes-56822.rs index 315b20ddd70..4ed1b6c5913 100644 --- a/tests/rustdoc/synthetic_auto/auto-trait-lifetimes-56822.rs +++ b/tests/rustdoc/synthetic_auto/auto-trait-lifetimes-56822.rs @@ -19,8 +19,8 @@ impl<'a, T> MyTrait for Inner<'a, T> { type Output = &'a T; } -// @has foo/struct.Parser.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has foo/struct.Parser.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<'a> Send for Parser<'a>" pub struct Parser<'a> { field: > as MyTrait>::Output diff --git a/tests/rustdoc/synthetic_auto/basic.rs b/tests/rustdoc/synthetic_auto/basic.rs index 16b8cce490c..9daf8963997 100644 --- a/tests/rustdoc/synthetic_auto/basic.rs +++ b/tests/rustdoc/synthetic_auto/basic.rs @@ -1,8 +1,8 @@ -// @has basic/struct.Foo.html -// @has - '//h3[@class="code-header"]' 'impl Send for Foowhere T: Send' -// @has - '//h3[@class="code-header"]' 'impl Sync for Foowhere T: Sync' -// @count - '//*[@id="implementations-list"]//*[@class="impl"]' 0 -// @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]' 6 +//@ has basic/struct.Foo.html +//@ has - '//h3[@class="code-header"]' 'impl Send for Foowhere T: Send' +//@ has - '//h3[@class="code-header"]' 'impl Sync for Foowhere T: Sync' +//@ count - '//*[@id="implementations-list"]//*[@class="impl"]' 0 +//@ count - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]' 6 pub struct Foo { field: T, } diff --git a/tests/rustdoc/synthetic_auto/bounds.rs b/tests/rustdoc/synthetic_auto/bounds.rs index 17528d01c8d..e93639acd07 100644 --- a/tests/rustdoc/synthetic_auto/bounds.rs +++ b/tests/rustdoc/synthetic_auto/bounds.rs @@ -1,8 +1,8 @@ pub struct Outer(Inner); pub struct Inner(T); -// @has bounds/struct.Outer.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has bounds/struct.Outer.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Unpin for Outerwhere \ // T: for<'any> Trait = (), X = ()>," diff --git a/tests/rustdoc/synthetic_auto/complex.rs b/tests/rustdoc/synthetic_auto/complex.rs index 2722f6d338f..51303658890 100644 --- a/tests/rustdoc/synthetic_auto/complex.rs +++ b/tests/rustdoc/synthetic_auto/complex.rs @@ -19,8 +19,8 @@ mod foo { } } -// @has complex/struct.NotOuter.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has complex/struct.NotOuter.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<'a, T, K> Send for Outer<'a, T, K>where 'a: 'static, T: MyTrait<'a>, \ // K: for<'b> Fn((&'b bool, &'a u8)) -> &'b i8 + ?Sized, >::MyItem: Copy," diff --git a/tests/rustdoc/synthetic_auto/crate-local.rs b/tests/rustdoc/synthetic_auto/crate-local.rs index ed01f63f998..b3bd67f839c 100644 --- a/tests/rustdoc/synthetic_auto/crate-local.rs +++ b/tests/rustdoc/synthetic_auto/crate-local.rs @@ -2,8 +2,8 @@ pub auto trait Banana {} -// @has crate_local/struct.Peach.html -// @has - '//h3[@class="code-header"]' 'impl Banana for Peach' -// @has - '//h3[@class="code-header"]' 'impl Send for Peach' -// @has - '//h3[@class="code-header"]' 'impl Sync for Peach' +//@ has crate_local/struct.Peach.html +//@ has - '//h3[@class="code-header"]' 'impl Banana for Peach' +//@ has - '//h3[@class="code-header"]' 'impl Send for Peach' +//@ has - '//h3[@class="code-header"]' 'impl Sync for Peach' pub struct Peach; diff --git a/tests/rustdoc/synthetic_auto/lifetimes.rs b/tests/rustdoc/synthetic_auto/lifetimes.rs index 23e1efdaeef..c47bd8f065c 100644 --- a/tests/rustdoc/synthetic_auto/lifetimes.rs +++ b/tests/rustdoc/synthetic_auto/lifetimes.rs @@ -8,11 +8,11 @@ where T: for<'b> Fn(&'b bool) -> &'a u8, {} -// @has lifetimes/struct.Foo.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has lifetimes/struct.Foo.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<'c, K> Send for Foo<'c, K>where 'c: 'static, K: for<'b> Fn(&'b bool) -> &'c u8," // -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<'c, K> Sync for Foo<'c, K>where K: Sync" pub struct Foo<'c, K: 'c> { inner_field: Inner<'c, K>, diff --git a/tests/rustdoc/synthetic_auto/manual.rs b/tests/rustdoc/synthetic_auto/manual.rs index 692d68294a7..bbf361a6e59 100644 --- a/tests/rustdoc/synthetic_auto/manual.rs +++ b/tests/rustdoc/synthetic_auto/manual.rs @@ -1,12 +1,12 @@ -// @has manual/struct.Foo.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has manual/struct.Foo.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // 'impl Sync for Foowhere T: Sync' // -// @has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@id="trait-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // 'impl Send for Foo' // -// @count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1 -// @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]' 5 +//@ count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1 +//@ count - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]' 5 pub struct Foo { field: T, } diff --git a/tests/rustdoc/synthetic_auto/negative.rs b/tests/rustdoc/synthetic_auto/negative.rs index 97da2d57424..a2fe6187e8e 100644 --- a/tests/rustdoc/synthetic_auto/negative.rs +++ b/tests/rustdoc/synthetic_auto/negative.rs @@ -2,11 +2,11 @@ pub struct Inner { field: *mut T, } -// @has negative/struct.Outer.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has negative/struct.Outer.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl !Send for Outer" // -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl !Sync for Outer" pub struct Outer { inner_field: Inner, diff --git a/tests/rustdoc/synthetic_auto/nested.rs b/tests/rustdoc/synthetic_auto/nested.rs index e4aead71bf2..edd7ca64698 100644 --- a/tests/rustdoc/synthetic_auto/nested.rs +++ b/tests/rustdoc/synthetic_auto/nested.rs @@ -8,11 +8,11 @@ where { } -// @has nested/struct.Foo.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has nested/struct.Foo.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // 'impl Send for Foowhere T: Copy' // -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // 'impl Sync for Foowhere T: Sync' pub struct Foo { inner_field: Inner, diff --git a/tests/rustdoc/synthetic_auto/no-redundancy.rs b/tests/rustdoc/synthetic_auto/no-redundancy.rs index 64dab429647..7260107d861 100644 --- a/tests/rustdoc/synthetic_auto/no-redundancy.rs +++ b/tests/rustdoc/synthetic_auto/no-redundancy.rs @@ -8,8 +8,8 @@ where { } -// @has no_redundancy/struct.Outer.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has no_redundancy/struct.Outer.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Send for Outerwhere T: Copy + Send" pub struct Outer { inner_field: Inner, diff --git a/tests/rustdoc/synthetic_auto/normalize-auto-trait-80233.rs b/tests/rustdoc/synthetic_auto/normalize-auto-trait-80233.rs index 06498018630..2552bca87d2 100644 --- a/tests/rustdoc/synthetic_auto/normalize-auto-trait-80233.rs +++ b/tests/rustdoc/synthetic_auto/normalize-auto-trait-80233.rs @@ -32,8 +32,8 @@ impl Trait3 for Vec { pub struct Struct1 {} -// @has foo/struct.Question.html -// @has - '//h3[@class="code-header"]' 'impl Send for Question' +//@ has foo/struct.Question.html +//@ has - '//h3[@class="code-header"]' 'impl Send for Question' pub struct Question { pub ins: < as Trait3>::Type3 as Trait2>::Type2, } diff --git a/tests/rustdoc/synthetic_auto/overflow.rs b/tests/rustdoc/synthetic_auto/overflow.rs index 35a487c764d..634217cfcdd 100644 --- a/tests/rustdoc/synthetic_auto/overflow.rs +++ b/tests/rustdoc/synthetic_auto/overflow.rs @@ -20,8 +20,8 @@ enum TyData { struct VariableKind(I::InternedType); -// @has overflow/struct.BoundVarsCollector.html -// @has - '//h3[@class="code-header"]' "impl<'tcx> Send for BoundVarsCollector<'tcx>" +//@ has overflow/struct.BoundVarsCollector.html +//@ has - '//h3[@class="code-header"]' "impl<'tcx> Send for BoundVarsCollector<'tcx>" pub struct BoundVarsCollector<'tcx> { val: VariableKind> } diff --git a/tests/rustdoc/synthetic_auto/project.rs b/tests/rustdoc/synthetic_auto/project.rs index f4ede76e6de..10046bff913 100644 --- a/tests/rustdoc/synthetic_auto/project.rs +++ b/tests/rustdoc/synthetic_auto/project.rs @@ -22,11 +22,11 @@ where { } -// @has project/struct.Foo.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has project/struct.Foo.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<'c, K> Send for Foo<'c, K>where 'c: 'static, K: MyTrait," // -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<'c, K> Sync for Foo<'c, K>where 'c: 'static, K: MyTrait, \ // ::MyItem: OtherTrait," pub struct Foo<'c, K: 'c> { diff --git a/tests/rustdoc/synthetic_auto/self-referential.rs b/tests/rustdoc/synthetic_auto/self-referential.rs index 145a2b7e00c..f6c7daeec8d 100644 --- a/tests/rustdoc/synthetic_auto/self-referential.rs +++ b/tests/rustdoc/synthetic_auto/self-referential.rs @@ -22,8 +22,8 @@ impl Pattern for Wrapper { } -// @has self_referential/struct.WriteAndThen.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has self_referential/struct.WriteAndThen.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Send for WriteAndThenwhere ::Value: Send" pub struct WriteAndThen(pub P1::Value,pub > as Pattern>::Value) where P1: Pattern; diff --git a/tests/rustdoc/synthetic_auto/send-impl-conditional-60726.rs b/tests/rustdoc/synthetic_auto/send-impl-conditional-60726.rs index ea10aee58e4..9937628cabe 100644 --- a/tests/rustdoc/synthetic_auto/send-impl-conditional-60726.rs +++ b/tests/rustdoc/synthetic_auto/send-impl-conditional-60726.rs @@ -28,10 +28,10 @@ where I:InterfaceType {} -// @has foo/struct.IntoIter.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has foo/struct.IntoIter.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl !Send for IntoIter" -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl !Sync for IntoIter" pub struct IntoIter{ hello:DynTrait>, diff --git a/tests/rustdoc/synthetic_auto/static-region.rs b/tests/rustdoc/synthetic_auto/static-region.rs index 9dc6211ec20..0b7d048765b 100644 --- a/tests/rustdoc/synthetic_auto/static-region.rs +++ b/tests/rustdoc/synthetic_auto/static-region.rs @@ -2,8 +2,8 @@ pub trait OwnedTrait<'a> { type Reader; } -// @has static_region/struct.Owned.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has static_region/struct.Owned.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Send for Ownedwhere >::Reader: Send" pub struct Owned where T: OwnedTrait<'static> { marker: >::Reader, diff --git a/tests/rustdoc/synthetic_auto/supertrait-bounds.rs b/tests/rustdoc/synthetic_auto/supertrait-bounds.rs index 503e65d0f4f..d96d16786e8 100644 --- a/tests/rustdoc/synthetic_auto/supertrait-bounds.rs +++ b/tests/rustdoc/synthetic_auto/supertrait-bounds.rs @@ -7,8 +7,8 @@ pub struct Type(T); -// @has supertrait_bounds/struct.Type.html -// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has supertrait_bounds/struct.Type.html +//@ has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \ // "impl Send for Typewhere T: Send," pub trait Bound: Copy + 'static {} diff --git a/tests/rustdoc/tab_title.rs b/tests/rustdoc/tab_title.rs index 8d781b40e46..59914065c91 100644 --- a/tests/rustdoc/tab_title.rs +++ b/tests/rustdoc/tab_title.rs @@ -4,42 +4,42 @@ // tests for the html element -// @has foo/index.html '//head/title' 'foo - Rust' +//@ has foo/index.html '//head/title' 'foo - Rust' -// @has foo/fn.widget_count.html '//head/title' 'widget_count in foo - Rust' +//@ has foo/fn.widget_count.html '//head/title' 'widget_count in foo - Rust' /// blah pub fn widget_count() {} -// @has foo/struct.Widget.html '//head/title' 'Widget in foo - Rust' +//@ has foo/struct.Widget.html '//head/title' 'Widget in foo - Rust' pub struct Widget; -// @has foo/constant.ANSWER.html '//head/title' 'ANSWER in foo - Rust' +//@ has foo/constant.ANSWER.html '//head/title' 'ANSWER in foo - Rust' pub const ANSWER: u8 = 42; -// @has foo/blah/index.html '//head/title' 'foo::blah - Rust' +//@ has foo/blah/index.html '//head/title' 'foo::blah - Rust' pub mod blah { - // @has foo/blah/struct.Widget.html '//head/title' 'Widget in foo::blah - Rust' + //@ has foo/blah/struct.Widget.html '//head/title' 'Widget in foo::blah - Rust' pub struct Widget; - // @has foo/blah/trait.Awesome.html '//head/title' 'Awesome in foo::blah - Rust' + //@ has foo/blah/trait.Awesome.html '//head/title' 'Awesome in foo::blah - Rust' pub trait Awesome {} - // @has foo/blah/fn.make_widget.html '//head/title' 'make_widget in foo::blah - Rust' + //@ has foo/blah/fn.make_widget.html '//head/title' 'make_widget in foo::blah - Rust' pub fn make_widget() {} - // @has foo/macro.cool_macro.html '//head/title' 'cool_macro in foo - Rust' + //@ has foo/macro.cool_macro.html '//head/title' 'cool_macro in foo - Rust' #[macro_export] macro_rules! cool_macro { ($t:tt) => { $t } } } -// @has foo/keyword.continue.html '//head/title' 'continue - Rust' +//@ has foo/keyword.continue.html '//head/title' 'continue - Rust' #[doc(keyword = "continue")] mod continue_keyword {} -// @has foo/primitive.u8.html '//head/title' 'u8 - Rust' -// @!has - '//head/title' 'foo' +//@ has foo/primitive.u8.html '//head/title' 'u8 - Rust' +//@ !has - '//head/title' 'foo' #[rustc_doc_primitive = "u8"] /// `u8` docs mod u8 {} diff --git a/tests/rustdoc/table-in-docblock.rs b/tests/rustdoc/table-in-docblock.rs index 194f49f16d0..af376438ce6 100644 --- a/tests/rustdoc/table-in-docblock.rs +++ b/tests/rustdoc/table-in-docblock.rs @@ -1,8 +1,8 @@ #![crate_name = "foo"] -// @has foo/struct.Foo.html -// @count - '//*[@class="docblock"]/div/table' 2 -// @!has - '//*[@class="docblock"]/table' '' +//@ has foo/struct.Foo.html +//@ count - '//*[@class="docblock"]/div/table' 2 +//@ !has - '//*[@class="docblock"]/table' '' /// | hello | hello2 | /// | ----- | ------ | /// | data | data2 | diff --git a/tests/rustdoc/task-lists.rs b/tests/rustdoc/task-lists.rs index c2e7dd60f22..f32bac89a65 100644 --- a/tests/rustdoc/task-lists.rs +++ b/tests/rustdoc/task-lists.rs @@ -4,10 +4,10 @@ // has task_lists/index.html '//li/input[@type="checkbox"]/following-sibling::text()' 'b' // Unfortunately that requires LXML, because the built-in xml module doesn't support all of xpath. -// @has task_lists/index.html '//ul/li/input[@type="checkbox"]' '' -// @has task_lists/index.html '//ul/li/input[@disabled]' '' -// @has task_lists/index.html '//ul/li' 'a' -// @has task_lists/index.html '//ul/li' 'b' +//@ has task_lists/index.html '//ul/li/input[@type="checkbox"]' '' +//@ has task_lists/index.html '//ul/li/input[@disabled]' '' +//@ has task_lists/index.html '//ul/li' 'a' +//@ has task_lists/index.html '//ul/li' 'b' //! This tests 'task list' support, a common markdown extension. //! - [ ] a //! - [x] b diff --git a/tests/rustdoc/test-lists.rs b/tests/rustdoc/test-lists.rs index 6a510b9ac5d..661f8f4d6fb 100644 --- a/tests/rustdoc/test-lists.rs +++ b/tests/rustdoc/test-lists.rs @@ -1,21 +1,21 @@ #![crate_name = "foo"] -// @has foo/fn.f.html -// @has - //ol/li "list" -// @has - //ol/li/ol/li "fooooo" -// @has - //ol/li/ol/li "x" -// @has - //ol/li "foo" +//@ has foo/fn.f.html +//@ has - //ol/li "list" +//@ has - //ol/li/ol/li "fooooo" +//@ has - //ol/li/ol/li "x" +//@ has - //ol/li "foo" /// 1. list /// 1. fooooo /// 2. x /// 2. foo pub fn f() {} -// @has foo/fn.foo2.html -// @has - //ul/li "normal list" -// @has - //ul/li/ul/li "sub list" -// @has - //ul/li/ul/li "new elem still same elem and again same elem!" -// @has - //ul/li "new big elem" +//@ has foo/fn.foo2.html +//@ has - //ul/li "normal list" +//@ has - //ul/li/ul/li "sub list" +//@ has - //ul/li/ul/li "new elem still same elem and again same elem!" +//@ has - //ul/li "new big elem" /// * normal list /// * sub list /// * new elem diff --git a/tests/rustdoc/test-parens.rs b/tests/rustdoc/test-parens.rs index 9640b96b6b5..4f362740e6f 100644 --- a/tests/rustdoc/test-parens.rs +++ b/tests/rustdoc/test-parens.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -// @has foo/fn.foo.html -// @has - '//pre[@class="rust item-decl"]' "_: &(dyn ToString + 'static)" +//@ has foo/fn.foo.html +//@ has - '//pre[@class="rust item-decl"]' "_: &(dyn ToString + 'static)" pub fn foo(_: &(ToString + 'static)) {} diff --git a/tests/rustdoc/test-strikethrough.rs b/tests/rustdoc/test-strikethrough.rs index 58162153b9e..6b9742e2a2f 100644 --- a/tests/rustdoc/test-strikethrough.rs +++ b/tests/rustdoc/test-strikethrough.rs @@ -3,11 +3,11 @@ // Test that strikethrough works with single and double tildes and that it shows up on // the item's dedicated page as well as the parent module's summary of items. -// @has foo/index.html //del 'strike' -// @has foo/index.html //del 'through' +//@ has foo/index.html //del 'strike' +//@ has foo/index.html //del 'through' -// @has foo/fn.f.html //del 'strike' -// @has foo/fn.f.html //del 'through' +//@ has foo/fn.f.html //del 'strike' +//@ has foo/fn.f.html //del 'through' /// ~~strike~~ ~through~ pub fn f() {} diff --git a/tests/rustdoc/thread-local-src.rs b/tests/rustdoc/thread-local-src.rs index 6de35e3233b..b23a9a48654 100644 --- a/tests/rustdoc/thread-local-src.rs +++ b/tests/rustdoc/thread-local-src.rs @@ -1,6 +1,6 @@ #![crate_name = "foo"] -// @has foo/index.html '//a[@href="../src/foo/thread-local-src.rs.html#1-6"]' 'source' +//@ has foo/index.html '//a[@href="../src/foo/thread-local-src.rs.html#1-6"]' 'source' -// @has foo/constant.FOO.html '//a[@href="../src/foo/thread-local-src.rs.html#6"]' 'source' +//@ has foo/constant.FOO.html '//a[@href="../src/foo/thread-local-src.rs.html#6"]' 'source' thread_local!(pub static FOO: bool = false); diff --git a/tests/rustdoc/titles.rs b/tests/rustdoc/titles.rs index f9da5a81375..bdf950b0a62 100644 --- a/tests/rustdoc/titles.rs +++ b/tests/rustdoc/titles.rs @@ -1,57 +1,57 @@ #![crate_name = "foo"] #![feature(rustc_attrs)] -// @matches 'foo/index.html' '//h1' 'Crate foo' -// @matches 'foo/index.html' '//div[@class="sidebar-crate"]/h2/a' 'foo' -// @count 'foo/index.html' '//h2[@class="location"]' 0 +//@ matches 'foo/index.html' '//h1' 'Crate foo' +//@ matches 'foo/index.html' '//div[@class="sidebar-crate"]/h2/a' 'foo' +//@ count 'foo/index.html' '//h2[@class="location"]' 0 -// @matches 'foo/foo_mod/index.html' '//h1' 'Module foo::foo_mod' -// @matches 'foo/foo_mod/index.html' '//h2[@class="location"]' 'Module foo_mod' +//@ matches 'foo/foo_mod/index.html' '//h1' 'Module foo::foo_mod' +//@ matches 'foo/foo_mod/index.html' '//h2[@class="location"]' 'Module foo_mod' pub mod foo_mod { pub struct __Thing {} } extern "C" { - // @matches 'foo/fn.foo_ffn.html' '//h1' 'Function foo::foo_ffn' + //@ matches 'foo/fn.foo_ffn.html' '//h1' 'Function foo::foo_ffn' pub fn foo_ffn(); } -// @matches 'foo/fn.foo_fn.html' '//h1' 'Function foo::foo_fn' +//@ matches 'foo/fn.foo_fn.html' '//h1' 'Function foo::foo_fn' pub fn foo_fn() {} -// @matches 'foo/trait.FooTrait.html' '//h1' 'Trait foo::FooTrait' -// @matches 'foo/trait.FooTrait.html' '//h2[@class="location"]' 'FooTrait' +//@ matches 'foo/trait.FooTrait.html' '//h1' 'Trait foo::FooTrait' +//@ matches 'foo/trait.FooTrait.html' '//h2[@class="location"]' 'FooTrait' pub trait FooTrait {} -// @matches 'foo/struct.FooStruct.html' '//h1' 'Struct foo::FooStruct' -// @matches 'foo/struct.FooStruct.html' '//h2[@class="location"]' 'FooStruct' +//@ matches 'foo/struct.FooStruct.html' '//h1' 'Struct foo::FooStruct' +//@ matches 'foo/struct.FooStruct.html' '//h2[@class="location"]' 'FooStruct' pub struct FooStruct; -// @matches 'foo/enum.FooEnum.html' '//h1' 'Enum foo::FooEnum' -// @matches 'foo/enum.FooEnum.html' '//h2[@class="location"]' 'FooEnum' +//@ matches 'foo/enum.FooEnum.html' '//h1' 'Enum foo::FooEnum' +//@ matches 'foo/enum.FooEnum.html' '//h2[@class="location"]' 'FooEnum' pub enum FooEnum {} -// @matches 'foo/type.FooType.html' '//h1' 'Type Alias foo::FooType' -// @matches 'foo/type.FooType.html' '//h2[@class="location"]' 'FooType' +//@ matches 'foo/type.FooType.html' '//h1' 'Type Alias foo::FooType' +//@ matches 'foo/type.FooType.html' '//h2[@class="location"]' 'FooType' pub type FooType = FooStruct; -// @matches 'foo/macro.foo_macro.html' '//h1' 'Macro foo::foo_macro' +//@ matches 'foo/macro.foo_macro.html' '//h1' 'Macro foo::foo_macro' #[macro_export] macro_rules! foo_macro { () => {}; } -// @matches 'foo/primitive.bool.html' '//h1' 'Primitive Type bool' +//@ matches 'foo/primitive.bool.html' '//h1' 'Primitive Type bool' #[rustc_doc_primitive = "bool"] mod bool {} -// @matches 'foo/static.FOO_STATIC.html' '//h1' 'Static foo::FOO_STATIC' +//@ matches 'foo/static.FOO_STATIC.html' '//h1' 'Static foo::FOO_STATIC' pub static FOO_STATIC: FooStruct = FooStruct; extern "C" { - // @matches 'foo/static.FOO_FSTATIC.html' '//h1' 'Static foo::FOO_FSTATIC' + //@ matches 'foo/static.FOO_FSTATIC.html' '//h1' 'Static foo::FOO_FSTATIC' pub static FOO_FSTATIC: FooStruct; } -// @matches 'foo/constant.FOO_CONSTANT.html' '//h1' 'Constant foo::FOO_CONSTANT' +//@ matches 'foo/constant.FOO_CONSTANT.html' '//h1' 'Constant foo::FOO_CONSTANT' pub const FOO_CONSTANT: FooStruct = FooStruct; diff --git a/tests/rustdoc/toggle-item-contents.rs b/tests/rustdoc/toggle-item-contents.rs index 1f745043894..1cc1da59105 100644 --- a/tests/rustdoc/toggle-item-contents.rs +++ b/tests/rustdoc/toggle-item-contents.rs @@ -1,15 +1,15 @@ #![allow(unused)] -// @has 'toggle_item_contents/struct.PubStruct.html' -// @count - '//details[@class="toggle type-contents-toggle"]' 0 +//@ has 'toggle_item_contents/struct.PubStruct.html' +//@ count - '//details[@class="toggle type-contents-toggle"]' 0 pub struct PubStruct { pub a: usize, pub b: usize, } -// @has 'toggle_item_contents/struct.BigPubStruct.html' -// @count - '//details[@class="toggle type-contents-toggle"]' 1 -// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 13 fields' +//@ has 'toggle_item_contents/struct.BigPubStruct.html' +//@ count - '//details[@class="toggle type-contents-toggle"]' 1 +//@ has - '//details[@class="toggle type-contents-toggle"]' 'Show 13 fields' pub struct BigPubStruct { pub a: usize, pub b: usize, @@ -26,9 +26,9 @@ pub struct BigPubStruct { pub m: usize, } -// @has 'toggle_item_contents/union.BigUnion.html' -// @count - '//details[@class="toggle type-contents-toggle"]' 1 -// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 13 fields' +//@ has 'toggle_item_contents/union.BigUnion.html' +//@ count - '//details[@class="toggle type-contents-toggle"]' 1 +//@ has - '//details[@class="toggle type-contents-toggle"]' 'Show 13 fields' pub union BigUnion { pub a: usize, pub b: usize, @@ -45,24 +45,24 @@ pub union BigUnion { pub m: usize, } -// @has 'toggle_item_contents/union.Union.html' -// @count - '//details[@class="toggle type-contents-toggle"]' 0 +//@ has 'toggle_item_contents/union.Union.html' +//@ count - '//details[@class="toggle type-contents-toggle"]' 0 pub union Union { pub a: usize, pub b: usize, pub c: usize, } -// @has 'toggle_item_contents/struct.PrivStruct.html' -// @count - '//details[@class="toggle type-contents-toggle"]' 0 -// @has - '//pre[@class="rust item-decl"]' '/* private fields */' +//@ has 'toggle_item_contents/struct.PrivStruct.html' +//@ count - '//details[@class="toggle type-contents-toggle"]' 0 +//@ has - '//pre[@class="rust item-decl"]' '/* private fields */' pub struct PrivStruct { a: usize, b: usize, } -// @has 'toggle_item_contents/enum.Enum.html' -// @!has - '//details[@class="toggle type-contents-toggle"]' '' +//@ has 'toggle_item_contents/enum.Enum.html' +//@ !has - '//details[@class="toggle type-contents-toggle"]' '' pub enum Enum { A, B, C, D { @@ -71,8 +71,8 @@ pub enum Enum { } } -// @has 'toggle_item_contents/enum.EnumStructVariant.html' -// @!has - '//details[@class="toggle type-contents-toggle"]' '' +//@ has 'toggle_item_contents/enum.EnumStructVariant.html' +//@ !has - '//details[@class="toggle type-contents-toggle"]' '' pub enum EnumStructVariant { A, B, C, D { @@ -80,15 +80,15 @@ pub enum EnumStructVariant { } } -// @has 'toggle_item_contents/enum.LargeEnum.html' -// @count - '//pre[@class="rust item-decl"]//details[@class="toggle type-contents-toggle"]' 1 -// @has - '//pre[@class="rust item-decl"]//details[@class="toggle type-contents-toggle"]' 'Show 13 variants' +//@ has 'toggle_item_contents/enum.LargeEnum.html' +//@ count - '//pre[@class="rust item-decl"]//details[@class="toggle type-contents-toggle"]' 1 +//@ has - '//pre[@class="rust item-decl"]//details[@class="toggle type-contents-toggle"]' 'Show 13 variants' pub enum LargeEnum { A, B, C, D, E, F(u8), G, H, I, J, K, L, M } -// @has 'toggle_item_contents/trait.Trait.html' -// @count - '//details[@class="toggle type-contents-toggle"]' 0 +//@ has 'toggle_item_contents/trait.Trait.html' +//@ count - '//details[@class="toggle type-contents-toggle"]' 0 pub trait Trait { type A; #[must_use] @@ -96,9 +96,9 @@ pub trait Trait { fn bar(); } -// @has 'toggle_item_contents/trait.GinormousTrait.html' -// @count - '//details[@class="toggle type-contents-toggle"]' 1 -// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 16 associated items' +//@ has 'toggle_item_contents/trait.GinormousTrait.html' +//@ count - '//details[@class="toggle type-contents-toggle"]' 1 +//@ has - '//details[@class="toggle type-contents-toggle"]' 'Show 16 associated items' pub trait GinormousTrait { type A; type B; @@ -119,9 +119,9 @@ pub trait GinormousTrait { fn bar(); } -// @has 'toggle_item_contents/trait.HugeTrait.html' -// @count - '//details[@class="toggle type-contents-toggle"]' 1 -// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 12 associated constants and 2 methods' +//@ has 'toggle_item_contents/trait.HugeTrait.html' +//@ count - '//details[@class="toggle type-contents-toggle"]' 1 +//@ has - '//details[@class="toggle type-contents-toggle"]' 'Show 12 associated constants and 2 methods' pub trait HugeTrait { type A; const M: usize = 1; @@ -141,9 +141,9 @@ pub trait HugeTrait { fn bar(); } -// @has 'toggle_item_contents/trait.GiganticTrait.html' -// @count - '//details[@class="toggle type-contents-toggle"]' 1 -// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 1 associated constant and 1 method' +//@ has 'toggle_item_contents/trait.GiganticTrait.html' +//@ count - '//details[@class="toggle type-contents-toggle"]' 1 +//@ has - '//details[@class="toggle type-contents-toggle"]' 'Show 1 associated constant and 1 method' pub trait GiganticTrait { type A; type B; @@ -162,9 +162,9 @@ pub trait GiganticTrait { fn foo(); } -// @has 'toggle_item_contents/trait.BigTrait.html' -// @count - '//details[@class="toggle type-contents-toggle"]' 1 -// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 14 methods' +//@ has 'toggle_item_contents/trait.BigTrait.html' +//@ count - '//details[@class="toggle type-contents-toggle"]' 1 +//@ has - '//details[@class="toggle type-contents-toggle"]' 'Show 14 methods' pub trait BigTrait { type A; #[must_use] diff --git a/tests/rustdoc/toggle-method.rs b/tests/rustdoc/toggle-method.rs index ebc316ca8ad..21057dfeb65 100644 --- a/tests/rustdoc/toggle-method.rs +++ b/tests/rustdoc/toggle-method.rs @@ -3,10 +3,10 @@ // Struct methods with documentation should be wrapped in a <details> toggle with an appropriate // summary. Struct methods with no documentation should not be wrapped. // -// @has foo/struct.Foo.html -// @has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented()' -// @has - '//details[@class="toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented' -// @!has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented()' +//@ has foo/struct.Foo.html +//@ has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented()' +//@ has - '//details[@class="toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented' +//@ !has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented()' pub struct Foo { } diff --git a/tests/rustdoc/toggle-trait-fn.rs b/tests/rustdoc/toggle-trait-fn.rs index 686a174fc8f..44cc6c8632a 100644 --- a/tests/rustdoc/toggle-trait-fn.rs +++ b/tests/rustdoc/toggle-trait-fn.rs @@ -3,15 +3,15 @@ // Trait methods with documentation should be wrapped in a <details> toggle with an appropriate // summary. Trait methods with no documentation should not be wrapped. // -// @has foo/trait.Foo.html -// @has - '//details[@class="toggle"]//summary//h4[@class="code-header"]' 'type Item' -// @!has - '//details[@class="toggle"]//summary//h4[@class="code-header"]' 'type Item2' -// @has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented()' -// @!has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented()' -// @has - '//details[@class="toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented' -// @has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented_optional()' -// @!has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented_optional()' -// @has - '//details[@class="toggle method-toggle"]//*[@class="docblock"]' 'is_documented_optional is documented' +//@ has foo/trait.Foo.html +//@ has - '//details[@class="toggle"]//summary//h4[@class="code-header"]' 'type Item' +//@ !has - '//details[@class="toggle"]//summary//h4[@class="code-header"]' 'type Item2' +//@ has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented()' +//@ !has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented()' +//@ has - '//details[@class="toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented' +//@ has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented_optional()' +//@ !has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented_optional()' +//@ has - '//details[@class="toggle method-toggle"]//*[@class="docblock"]' 'is_documented_optional is documented' pub trait Foo { /// is documented type Item; diff --git a/tests/rustdoc/trait-alias-mention.rs b/tests/rustdoc/trait-alias-mention.rs index 102bdca7d35..b6ef926e644 100644 --- a/tests/rustdoc/trait-alias-mention.rs +++ b/tests/rustdoc/trait-alias-mention.rs @@ -5,6 +5,6 @@ extern crate trait_alias_mention; -// @has foo/fn.mention_alias_in_bounds.html '//a[@href="../trait_alias_mention/traitalias.SomeAlias.html"]' 'SomeAlias' +//@ has foo/fn.mention_alias_in_bounds.html '//a[@href="../trait_alias_mention/traitalias.SomeAlias.html"]' 'SomeAlias' pub fn mention_alias_in_bounds<T: trait_alias_mention::SomeAlias>() { } diff --git a/tests/rustdoc/trait-impl-items-links-and-anchors.rs b/tests/rustdoc/trait-impl-items-links-and-anchors.rs index a125fa03679..c1845a33b9d 100644 --- a/tests/rustdoc/trait-impl-items-links-and-anchors.rs +++ b/tests/rustdoc/trait-impl-items-links-and-anchors.rs @@ -7,59 +7,59 @@ pub trait MyTrait { } impl MyTrait for String { - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-1"]//a[@class="associatedtype"]/@href' #associatedtype.Assoc - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-1"]//a[@class="anchor"]/@href' #associatedtype.Assoc-1 + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-1"]//a[@class="associatedtype"]/@href' #associatedtype.Assoc + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-1"]//a[@class="anchor"]/@href' #associatedtype.Assoc-1 type Assoc = (); - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-1"]//a[@class="constant"]/@href' #associatedconstant.VALUE - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-1"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-1 + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-1"]//a[@class="constant"]/@href' #associatedconstant.VALUE + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-1"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-1 const VALUE: u32 = 5; - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' #tymethod.trait_function - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' #tymethod.trait_function + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function fn trait_function(&self) {} - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-1"]//a[@class="fn"]/@href' #method.defaulted_override - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-1"]//a[@class="anchor"]/@href' #method.defaulted_override-1 + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-1"]//a[@class="fn"]/@href' #method.defaulted_override + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-1"]//a[@class="anchor"]/@href' #method.defaulted_override-1 fn defaulted_override(&self) {} } impl MyTrait for Vec<u8> { - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-2"]//a[@class="associatedtype"]/@href' #associatedtype.Assoc - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-2"]//a[@class="anchor"]/@href' #associatedtype.Assoc-2 + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-2"]//a[@class="associatedtype"]/@href' #associatedtype.Assoc + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-2"]//a[@class="anchor"]/@href' #associatedtype.Assoc-2 type Assoc = (); - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-2"]//a[@class="constant"]/@href' #associatedconstant.VALUE - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-2"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-2 + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-2"]//a[@class="constant"]/@href' #associatedconstant.VALUE + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-2"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-2 const VALUE: u32 = 5; - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' #tymethod.trait_function - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function-1"]//a[@class="anchor"]/@href' #method.trait_function-1 + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' #tymethod.trait_function + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.trait_function-1"]//a[@class="anchor"]/@href' #method.trait_function-1 fn trait_function(&self) {} - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-2"]//a[@class="fn"]/@href' #method.defaulted_override - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-2"]//a[@class="anchor"]/@href' #method.defaulted_override-2 + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-2"]//a[@class="fn"]/@href' #method.defaulted_override + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="method.defaulted_override-2"]//a[@class="anchor"]/@href' #method.defaulted_override-2 fn defaulted_override(&self) {} } impl MyTrait for MyStruct { - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-3"]//a[@class="anchor"]/@href' #associatedtype.Assoc-3 - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedtype.Assoc"]//a[@class="associatedtype"]/@href' trait.MyTrait.html#associatedtype.Assoc - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedtype.Assoc"]//a[@class="anchor"]/@href' #associatedtype.Assoc + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedtype.Assoc-3"]//a[@class="anchor"]/@href' #associatedtype.Assoc-3 + //@ has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedtype.Assoc"]//a[@class="associatedtype"]/@href' trait.MyTrait.html#associatedtype.Assoc + //@ has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedtype.Assoc"]//a[@class="anchor"]/@href' #associatedtype.Assoc type Assoc = bool; - // @has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-3"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-3 - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedconstant.VALUE"]//a[@class="constant"]/@href' trait.MyTrait.html#associatedconstant.VALUE - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedconstant.VALUE"]//a[@class="anchor"]/@href' #associatedconstant.VALUE + //@ has trait_impl_items_links_and_anchors/trait.MyTrait.html '//*[@id="associatedconstant.VALUE-3"]//a[@class="anchor"]/@href' #associatedconstant.VALUE-3 + //@ has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedconstant.VALUE"]//a[@class="constant"]/@href' trait.MyTrait.html#associatedconstant.VALUE + //@ has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="associatedconstant.VALUE"]//a[@class="anchor"]/@href' #associatedconstant.VALUE const VALUE: u32 = 20; - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' trait.MyTrait.html#tymethod.trait_function - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function + //@ has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.trait_function"]//a[@class="fn"]/@href' trait.MyTrait.html#tymethod.trait_function + //@ has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.trait_function"]//a[@class="anchor"]/@href' #method.trait_function fn trait_function(&self) {} - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted_override"]//a[@class="fn"]/@href' trait.MyTrait.html#method.defaulted_override - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted_override"]//a[@class="anchor"]/@href' #method.defaulted_override + //@ has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted_override"]//a[@class="fn"]/@href' trait.MyTrait.html#method.defaulted_override + //@ has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted_override"]//a[@class="anchor"]/@href' #method.defaulted_override fn defaulted_override(&self) {} - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted"]//a[@class="fn"]/@href' trait.MyTrait.html#method.defaulted - // @has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted"]//a[@class="anchor"]/@href' #method.defaulted + //@ has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted"]//a[@class="fn"]/@href' trait.MyTrait.html#method.defaulted + //@ has trait_impl_items_links_and_anchors/struct.MyStruct.html '//*[@id="method.defaulted"]//a[@class="anchor"]/@href' #method.defaulted } pub struct MyStruct; // We check that associated items with default values aren't generated in the implementors list. impl MyTrait for (u8, u8) { - // @!has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-4"]' '' + //@ !has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-4"]' '' type Assoc = bool; fn trait_function(&self) {} } diff --git a/tests/rustdoc/trait-impl.rs b/tests/rustdoc/trait-impl.rs index 9cf3226f738..c65eecc4edf 100644 --- a/tests/rustdoc/trait-impl.rs +++ b/tests/rustdoc/trait-impl.rs @@ -21,25 +21,25 @@ pub trait Trait { pub struct Struct; impl Trait for Struct { - // @has trait_impl/struct.Struct.html '//*[@id="method.a"]/../../div[@class="docblock"]' 'Some long docs' - // @!has - '//*[@id="method.a"]/../../div[@class="docblock"]' 'link will be added' - // @has - '//*[@id="method.a"]/../../div[@class="docblock"]/a' 'Read more' - // @has - '//*[@id="method.a"]/../../div[@class="docblock"]/a/@href' 'trait.Trait.html#tymethod.a' + //@ has trait_impl/struct.Struct.html '//*[@id="method.a"]/../../div[@class="docblock"]' 'Some long docs' + //@ !has - '//*[@id="method.a"]/../../div[@class="docblock"]' 'link will be added' + //@ has - '//*[@id="method.a"]/../../div[@class="docblock"]/a' 'Read more' + //@ has - '//*[@id="method.a"]/../../div[@class="docblock"]/a/@href' 'trait.Trait.html#tymethod.a' fn a() {} - // @has - '//*[@id="method.b"]/../../div[@class="docblock"]' 'These docs contain' - // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/a' 'reference link' - // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/a/@href' 'https://example.com' + //@ has - '//*[@id="method.b"]/../../div[@class="docblock"]' 'These docs contain' + //@ has - '//*[@id="method.b"]/../../div[@class="docblock"]/a' 'reference link' + //@ has - '//*[@id="method.b"]/../../div[@class="docblock"]/a/@href' 'https://example.com' fn b() {} - // @!has - '//*[@id="method.c"]/../../div[@class="docblock"]' 'code block' - // @has - '//*[@id="method.c"]/../../div[@class="docblock"]/a' 'Read more' - // @has - '//*[@id="method.c"]/../../div[@class="docblock"]/a/@href' 'trait.Trait.html#tymethod.c' + //@ !has - '//*[@id="method.c"]/../../div[@class="docblock"]' 'code block' + //@ has - '//*[@id="method.c"]/../../div[@class="docblock"]/a' 'Read more' + //@ has - '//*[@id="method.c"]/../../div[@class="docblock"]/a/@href' 'trait.Trait.html#tymethod.c' fn c() {} - // @has - '//*[@id="method.d"]/../../div[@class="docblock"]' 'Escaped formatting a*b*c* works' - // @!has - '//*[@id="method.d"]/../../div[@class="docblock"]/em' '' + //@ has - '//*[@id="method.d"]/../../div[@class="docblock"]' 'Escaped formatting a*b*c* works' + //@ !has - '//*[@id="method.d"]/../../div[@class="docblock"]/em' '' fn d() {} - // @has - '//*[@id="impl-Trait-for-Struct"]/h3//a/@href' 'trait.Trait.html' + //@ has - '//*[@id="impl-Trait-for-Struct"]/h3//a/@href' 'trait.Trait.html' } diff --git a/tests/rustdoc/trait-implementations-duplicate-self-45584.rs b/tests/rustdoc/trait-implementations-duplicate-self-45584.rs index 77b8c05f2fb..8eb6d007525 100644 --- a/tests/rustdoc/trait-implementations-duplicate-self-45584.rs +++ b/tests/rustdoc/trait-implementations-duplicate-self-45584.rs @@ -4,14 +4,14 @@ pub trait Bar<T, U> {} -// @has 'foo/struct.Foo1.html' +//@ has 'foo/struct.Foo1.html' pub struct Foo1; -// @count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1 -// @has - '//*[@class="impl"]' "impl Bar<Foo1, &'static Foo1> for Foo1" +//@ count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1 +//@ has - '//*[@class="impl"]' "impl Bar<Foo1, &'static Foo1> for Foo1" impl Bar<Foo1, &'static Foo1> for Foo1 {} -// @has 'foo/struct.Foo2.html' +//@ has 'foo/struct.Foo2.html' pub struct Foo2; -// @count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1 -// @has - '//*[@class="impl"]' "impl Bar<&'static Foo2, Foo2> for u8" +//@ count - '//*[@id="trait-implementations-list"]//*[@class="impl"]' 1 +//@ has - '//*[@class="impl"]' "impl Bar<&'static Foo2, Foo2> for u8" impl Bar<&'static Foo2, Foo2> for u8 {} diff --git a/tests/rustdoc/trait-item-info.rs b/tests/rustdoc/trait-item-info.rs index 53a4c6917b9..f158bba9893 100644 --- a/tests/rustdoc/trait-item-info.rs +++ b/tests/rustdoc/trait-item-info.rs @@ -7,16 +7,16 @@ #![unstable(feature = "test", issue = "none")] -// @has 'foo/trait.Foo.html' +//@ has 'foo/trait.Foo.html' #[stable(feature = "rust2", since = "2.2.2")] pub trait Foo { - // @has - '//div[@class="methods"]/span[@class="item-info"]' 'bla' + //@ has - '//div[@class="methods"]/span[@class="item-info"]' 'bla' // Should not be in a `<details>` because there is no doc. #[unstable(feature = "bla", reason = "bla", issue = "111")] fn bla() {} - // @has - '//details[@class="toggle method-toggle"]/summary/span[@class="item-info"]' 'bar' + //@ has - '//details[@class="toggle method-toggle"]/summary/span[@class="item-info"]' 'bar' // Should have a `<summary>` in the `<details>` containing the unstable info. /// doc #[unstable(feature = "bar", reason = "bla", issue = "222")] diff --git a/tests/rustdoc/trait-object-safe.rs b/tests/rustdoc/trait-object-safe.rs index 8b028ad2e13..b4e986c8f69 100644 --- a/tests/rustdoc/trait-object-safe.rs +++ b/tests/rustdoc/trait-object-safe.rs @@ -1,27 +1,27 @@ #![crate_name = "foo"] -// @has 'foo/trait.Unsafe.html' -// @has - '//*[@class="object-safety-info"]' 'This trait is not object safe.' -// @has - '//*[@id="object-safety"]' 'Object Safety' +//@ has 'foo/trait.Unsafe.html' +//@ has - '//*[@class="object-safety-info"]' 'This trait is not object safe.' +//@ has - '//*[@id="object-safety"]' 'Object Safety' pub trait Unsafe { fn foo() -> Self; } -// @has 'foo/trait.Unsafe2.html' -// @has - '//*[@class="object-safety-info"]' 'This trait is not object safe.' -// @has - '//*[@id="object-safety"]' 'Object Safety' +//@ has 'foo/trait.Unsafe2.html' +//@ has - '//*[@class="object-safety-info"]' 'This trait is not object safe.' +//@ has - '//*[@id="object-safety"]' 'Object Safety' pub trait Unsafe2<T> { fn foo(i: T); } -// @has 'foo/trait.Safe.html' -// @!has - '//*[@class="object-safety-info"]' '' -// @!has - '//*[@id="object-safety"]' '' +//@ has 'foo/trait.Safe.html' +//@ !has - '//*[@class="object-safety-info"]' '' +//@ !has - '//*[@id="object-safety"]' '' pub trait Safe { fn foo(&self); } -// @has 'foo/struct.Foo.html' -// @count - '//*[@class="object-safety-info"]' 0 -// @count - '//*[@id="object-safety"]' 0 +//@ has 'foo/struct.Foo.html' +//@ count - '//*[@class="object-safety-info"]' 0 +//@ count - '//*[@id="object-safety"]' 0 pub struct Foo; diff --git a/tests/rustdoc/trait-self-link.rs b/tests/rustdoc/trait-self-link.rs index e311dadff0e..fe69158b1a2 100644 --- a/tests/rustdoc/trait-self-link.rs +++ b/tests/rustdoc/trait-self-link.rs @@ -1,4 +1,4 @@ -// @has trait_self_link/trait.Foo.html //a/@href trait.Foo.html +//@ has trait_self_link/trait.Foo.html //a/@href trait.Foo.html pub trait Foo {} pub struct Bar; diff --git a/tests/rustdoc/trait-src-link.rs b/tests/rustdoc/trait-src-link.rs index a6367efba61..7c3afb7d7d3 100644 --- a/tests/rustdoc/trait-src-link.rs +++ b/tests/rustdoc/trait-src-link.rs @@ -1,26 +1,26 @@ #![crate_name = "quix"] pub trait Foo { - // @has quix/trait.Foo.html '//a[@href="../src/quix/trait-src-link.rs.html#4"]' 'source' + //@ has quix/trait.Foo.html '//a[@href="../src/quix/trait-src-link.rs.html#4"]' 'source' fn required(); - // @has quix/trait.Foo.html '//a[@href="../src/quix/trait-src-link.rs.html#7"]' 'source' + //@ has quix/trait.Foo.html '//a[@href="../src/quix/trait-src-link.rs.html#7"]' 'source' fn provided() {} } pub struct Bar; impl Foo for Bar { - // @has quix/struct.Bar.html '//a[@href="../src/quix/trait-src-link.rs.html#14"]' 'source' + //@ has quix/struct.Bar.html '//a[@href="../src/quix/trait-src-link.rs.html#14"]' 'source' fn required() {} - // @has quix/struct.Bar.html '//a[@href="../src/quix/trait-src-link.rs.html#7"]' 'source' + //@ has quix/struct.Bar.html '//a[@href="../src/quix/trait-src-link.rs.html#7"]' 'source' } pub struct Baz; impl Foo for Baz { - // @has quix/struct.Baz.html '//a[@href="../src/quix/trait-src-link.rs.html#22"]' 'source' + //@ has quix/struct.Baz.html '//a[@href="../src/quix/trait-src-link.rs.html#22"]' 'source' fn required() {} - // @has quix/struct.Baz.html '//a[@href="../src/quix/trait-src-link.rs.html#25"]' 'source' + //@ has quix/struct.Baz.html '//a[@href="../src/quix/trait-src-link.rs.html#25"]' 'source' fn provided() {} } diff --git a/tests/rustdoc/trait-visibility.rs b/tests/rustdoc/trait-visibility.rs index af9750ac8d0..bdb71a1bb45 100644 --- a/tests/rustdoc/trait-visibility.rs +++ b/tests/rustdoc/trait-visibility.rs @@ -4,5 +4,5 @@ extern crate trait_visibility; -// @has foo/trait.Bar.html '//a[@href="#tymethod.foo"]/..' "fn foo()" +//@ has foo/trait.Bar.html '//a[@href="#tymethod.foo"]/..' "fn foo()" pub use trait_visibility::Bar; diff --git a/tests/rustdoc/trait_alias.rs b/tests/rustdoc/trait_alias.rs index 5c3f82c6b3c..bfdb9d40e2d 100644 --- a/tests/rustdoc/trait_alias.rs +++ b/tests/rustdoc/trait_alias.rs @@ -4,23 +4,23 @@ use std::fmt::Debug; -// @has foo/all.html '//a[@href="traitalias.CopyAlias.html"]' 'CopyAlias' -// @has foo/all.html '//a[@href="traitalias.Alias2.html"]' 'Alias2' -// @has foo/all.html '//a[@href="traitalias.Foo.html"]' 'Foo' +//@ has foo/all.html '//a[@href="traitalias.CopyAlias.html"]' 'CopyAlias' +//@ has foo/all.html '//a[@href="traitalias.Alias2.html"]' 'Alias2' +//@ has foo/all.html '//a[@href="traitalias.Foo.html"]' 'Foo' -// @has foo/index.html '//h2[@id="trait-aliases"]' 'Trait Aliases' -// @has foo/index.html '//a[@class="traitalias"]' 'CopyAlias' -// @has foo/index.html '//a[@class="traitalias"]' 'Alias2' -// @has foo/index.html '//a[@class="traitalias"]' 'Foo' +//@ has foo/index.html '//h2[@id="trait-aliases"]' 'Trait Aliases' +//@ has foo/index.html '//a[@class="traitalias"]' 'CopyAlias' +//@ has foo/index.html '//a[@class="traitalias"]' 'Alias2' +//@ has foo/index.html '//a[@class="traitalias"]' 'Foo' -// @has foo/traitalias.CopyAlias.html -// @has - '//section[@id="main-content"]/pre[@class="rust item-decl"]' 'trait CopyAlias = Copy;' +//@ has foo/traitalias.CopyAlias.html +//@ has - '//section[@id="main-content"]/pre[@class="rust item-decl"]' 'trait CopyAlias = Copy;' pub trait CopyAlias = Copy; -// @has foo/traitalias.Alias2.html -// @has - '//section[@id="main-content"]/pre[@class="rust item-decl"]' 'trait Alias2 = Copy + Debug;' +//@ has foo/traitalias.Alias2.html +//@ has - '//section[@id="main-content"]/pre[@class="rust item-decl"]' 'trait Alias2 = Copy + Debug;' pub trait Alias2 = Copy + Debug; -// @has foo/traitalias.Foo.html -// @has - '//section[@id="main-content"]/pre[@class="rust item-decl"]' 'trait Foo<T> = Into<T> + Debug;' +//@ has foo/traitalias.Foo.html +//@ has - '//section[@id="main-content"]/pre[@class="rust item-decl"]' 'trait Foo<T> = Into<T> + Debug;' pub trait Foo<T> = Into<T> + Debug; -// @has foo/fn.bar.html '//a[@href="traitalias.Alias2.html"]' 'Alias2' +//@ has foo/fn.bar.html '//a[@href="traitalias.Alias2.html"]' 'Alias2' pub fn bar<T>() where T: Alias2 {} diff --git a/tests/rustdoc/traits-in-bodies-private.rs b/tests/rustdoc/traits-in-bodies-private.rs index 5a21b8b2625..a3455b3255b 100644 --- a/tests/rustdoc/traits-in-bodies-private.rs +++ b/tests/rustdoc/traits-in-bodies-private.rs @@ -3,8 +3,8 @@ //@ compile-flags:--document-private-items -// @has traits_in_bodies_private/struct.SomeStruct.html -// @!has - '//code' 'impl HiddenTrait for SomeStruct' +//@ has traits_in_bodies_private/struct.SomeStruct.html +//@ !has - '//code' 'impl HiddenTrait for SomeStruct' pub struct SomeStruct; fn __implementation_details() { diff --git a/tests/rustdoc/traits-in-bodies.rs b/tests/rustdoc/traits-in-bodies.rs index a65dd7a546c..a6f6158afa4 100644 --- a/tests/rustdoc/traits-in-bodies.rs +++ b/tests/rustdoc/traits-in-bodies.rs @@ -3,8 +3,8 @@ pub struct Bounded<T: Clone>(T); -// @has traits_in_bodies/struct.SomeStruct.html -// @has - '//h3[@class="code-header"]' 'impl Clone for SomeStruct' +//@ has traits_in_bodies/struct.SomeStruct.html +//@ has - '//h3[@class="code-header"]' 'impl Clone for SomeStruct' pub struct SomeStruct; fn asdf() -> Bounded<SomeStruct> { @@ -17,8 +17,8 @@ fn asdf() -> Bounded<SomeStruct> { Bounded(SomeStruct) } -// @has traits_in_bodies/struct.Point.html -// @has - '//h3[@class="code-header"]' 'impl Copy for Point' +//@ has traits_in_bodies/struct.Point.html +//@ has - '//h3[@class="code-header"]' 'impl Copy for Point' #[derive(Clone)] pub struct Point { x: i32, @@ -30,8 +30,8 @@ const _FOO: () = { () }; -// @has traits_in_bodies/struct.Inception.html -// @has - '//h3[@class="code-header"]' 'impl Clone for Inception' +//@ has traits_in_bodies/struct.Inception.html +//@ has - '//h3[@class="code-header"]' 'impl Clone for Inception' pub struct Inception; static _BAR: usize = { diff --git a/tests/rustdoc/tuple-struct-fields-doc.rs b/tests/rustdoc/tuple-struct-fields-doc.rs index 2836ddedc2b..55ee6662139 100644 --- a/tests/rustdoc/tuple-struct-fields-doc.rs +++ b/tests/rustdoc/tuple-struct-fields-doc.rs @@ -1,14 +1,14 @@ #![crate_name = "foo"] -// @has foo/struct.Foo.html -// @has - '//h2[@id="fields"]' 'Tuple Fields' -// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Tuple Fields' -// @has - '//*[@id="structfield.0"]' '0: u32' -// @has - '//*[@id="main-content"]/div[@class="docblock"]' 'hello' -// @!has - '//*[@id="structfield.1"]' '' -// @has - '//*[@id="structfield.2"]' '2: char' -// @has - '//*[@id="structfield.3"]' '3: i8' -// @has - '//*[@id="main-content"]/div[@class="docblock"]' 'not hello' +//@ has foo/struct.Foo.html +//@ has - '//h2[@id="fields"]' 'Tuple Fields' +//@ has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Tuple Fields' +//@ has - '//*[@id="structfield.0"]' '0: u32' +//@ has - '//*[@id="main-content"]/div[@class="docblock"]' 'hello' +//@ !has - '//*[@id="structfield.1"]' '' +//@ has - '//*[@id="structfield.2"]' '2: char' +//@ has - '//*[@id="structfield.3"]' '3: i8' +//@ has - '//*[@id="main-content"]/div[@class="docblock"]' 'not hello' pub struct Foo( /// hello pub u32, @@ -18,15 +18,15 @@ pub struct Foo( pub i8, ); -// @has foo/enum.Bar.html -// @has - '//pre[@class="rust item-decl"]' 'BarVariant(String),' -// @matches - '//*[@id="variant.BarVariant.fields"]/h4' '^Tuple Fields$' -// @has - '//*[@id="variant.BarVariant.field.0"]' '0: String' -// @has - '//*[@id="variant.BarVariant.fields"]//*[@class="docblock"]' 'Hello docs' -// @matches - '//*[@id="variant.FooVariant.fields"]/h4' '^Fields$' -// @has - '//*[@id="variant.BazVariant.fields"]//*[@class="docblock"]' 'dox' -// @has - '//*[@id="variant.OtherVariant.fields"]//*[@class="docblock"]' 'dox' -// @!matches - '//*[@id="variant.QuuxVariant.fields"]/h4' '^Tuple Fields$' +//@ has foo/enum.Bar.html +//@ has - '//pre[@class="rust item-decl"]' 'BarVariant(String),' +//@ matches - '//*[@id="variant.BarVariant.fields"]/h4' '^Tuple Fields$' +//@ has - '//*[@id="variant.BarVariant.field.0"]' '0: String' +//@ has - '//*[@id="variant.BarVariant.fields"]//*[@class="docblock"]' 'Hello docs' +//@ matches - '//*[@id="variant.FooVariant.fields"]/h4' '^Fields$' +//@ has - '//*[@id="variant.BazVariant.fields"]//*[@class="docblock"]' 'dox' +//@ has - '//*[@id="variant.OtherVariant.fields"]//*[@class="docblock"]' 'dox' +//@ !matches - '//*[@id="variant.QuuxVariant.fields"]/h4' '^Tuple Fields$' pub enum Bar { BarVariant( /// Hello docs diff --git a/tests/rustdoc/tuple-struct-where-clause-34928.rs b/tests/rustdoc/tuple-struct-where-clause-34928.rs index 909b9146893..804663a86f4 100644 --- a/tests/rustdoc/tuple-struct-where-clause-34928.rs +++ b/tests/rustdoc/tuple-struct-where-clause-34928.rs @@ -4,5 +4,5 @@ pub trait Bar {} -// @has foo/struct.Foo.html '//pre' 'pub struct Foo<T>(pub T) where T: Bar;' +//@ has foo/struct.Foo.html '//pre' 'pub struct Foo<T>(pub T) where T: Bar;' pub struct Foo<T>(pub T) where T: Bar; diff --git a/tests/rustdoc/tuples.rs b/tests/rustdoc/tuples.rs index 0ea5b5bfac9..a0c0ad7cd9a 100644 --- a/tests/rustdoc/tuples.rs +++ b/tests/rustdoc/tuples.rs @@ -1,20 +1,20 @@ #![crate_name = "foo"] -// @has foo/fn.tuple0.html //pre 'pub fn tuple0(x: ())' -// @snapshot link_unit - '//pre[@class="rust item-decl"]/code' +//@ has foo/fn.tuple0.html //pre 'pub fn tuple0(x: ())' +//@ snapshot link_unit - '//pre[@class="rust item-decl"]/code' pub fn tuple0(x: ()) -> () { x } -// @has foo/fn.tuple1.html //pre 'pub fn tuple1(x: (i32,)) -> (i32,)' -// @snapshot link1_i32 - '//pre[@class="rust item-decl"]/code' +//@ has foo/fn.tuple1.html //pre 'pub fn tuple1(x: (i32,)) -> (i32,)' +//@ snapshot link1_i32 - '//pre[@class="rust item-decl"]/code' pub fn tuple1(x: (i32,)) -> (i32,) { x } -// @has foo/fn.tuple2.html //pre 'pub fn tuple2(x: (i32, i32)) -> (i32, i32)' -// @snapshot link2_i32 - '//pre[@class="rust item-decl"]/code' +//@ has foo/fn.tuple2.html //pre 'pub fn tuple2(x: (i32, i32)) -> (i32, i32)' +//@ snapshot link2_i32 - '//pre[@class="rust item-decl"]/code' pub fn tuple2(x: (i32, i32)) -> (i32, i32) { x } -// @has foo/fn.tuple1_t.html //pre 'pub fn tuple1_t<T>(x: (T,)) -> (T,)' -// @snapshot link1_t - '//pre[@class="rust item-decl"]/code' +//@ has foo/fn.tuple1_t.html //pre 'pub fn tuple1_t<T>(x: (T,)) -> (T,)' +//@ snapshot link1_t - '//pre[@class="rust item-decl"]/code' pub fn tuple1_t<T>(x: (T,)) -> (T,) { x } -// @has foo/fn.tuple2_t.html //pre 'pub fn tuple2_t<T>(x: (T, T)) -> (T, T)' -// @snapshot link2_t - '//pre[@class="rust item-decl"]/code' +//@ has foo/fn.tuple2_t.html //pre 'pub fn tuple2_t<T>(x: (T, T)) -> (T, T)' +//@ snapshot link2_t - '//pre[@class="rust item-decl"]/code' pub fn tuple2_t<T>(x: (T, T)) -> (T, T) { x } -// @has foo/fn.tuple2_tu.html //pre 'pub fn tuple2_tu<T, U>(x: (T, U)) -> (T, U)' -// @snapshot link2_tu - '//pre[@class="rust item-decl"]/code' +//@ has foo/fn.tuple2_tu.html //pre 'pub fn tuple2_tu<T, U>(x: (T, U)) -> (T, U)' +//@ snapshot link2_tu - '//pre[@class="rust item-decl"]/code' pub fn tuple2_tu<T, U>(x: (T, U)) -> (T, U) { x } diff --git a/tests/rustdoc/type-alias/cross-crate-115718.rs b/tests/rustdoc/type-alias/cross-crate-115718.rs index 3d94be5ddbd..578d2190c5e 100644 --- a/tests/rustdoc/type-alias/cross-crate-115718.rs +++ b/tests/rustdoc/type-alias/cross-crate-115718.rs @@ -23,12 +23,12 @@ impl MyTrait3 for MyType { fn method_trait_3() {} } -// @hasraw 'type.impl/parent_crate_115718/struct.MyStruct.js' 'method_trait_1' -// @hasraw 'type.impl/parent_crate_115718/struct.MyStruct.js' 'method_trait_2' +//@ hasraw 'type.impl/parent_crate_115718/struct.MyStruct.js' 'method_trait_1' +//@ hasraw 'type.impl/parent_crate_115718/struct.MyStruct.js' 'method_trait_2' // Avoid duplicating these docs. -// @!hasraw 'foo/type.MyType.html' 'method_trait_1' -// @!hasraw 'foo/type.MyType.html' 'method_trait_2' +//@ !hasraw 'foo/type.MyType.html' 'method_trait_1' +//@ !hasraw 'foo/type.MyType.html' 'method_trait_2' // The one made directly on the type alias should be attached to the HTML instead. -// @!hasraw 'type.impl/parent_crate_115718/struct.MyStruct.js' 'method_trait_3' -// @hasraw 'foo/type.MyType.html' 'method_trait_3' +//@ !hasraw 'type.impl/parent_crate_115718/struct.MyStruct.js' 'method_trait_3' +//@ hasraw 'foo/type.MyType.html' 'method_trait_3' pub type MyType = MyStruct<u16>; diff --git a/tests/rustdoc/type-alias/deref-32077.rs b/tests/rustdoc/type-alias/deref-32077.rs index 186ebb1a632..79a83381340 100644 --- a/tests/rustdoc/type-alias/deref-32077.rs +++ b/tests/rustdoc/type-alias/deref-32077.rs @@ -18,25 +18,25 @@ pub trait Bar {} impl<T> Foo for GenericStruct<T> {} impl Bar for GenericStruct<u32> {} -// @has 'foo/type.TypedefStruct.html' +//@ has 'foo/type.TypedefStruct.html' // We check that "Aliased type" is also present as a title in the sidebar. -// @has - '//*[@class="sidebar-elems"]//h3/a[@href="#aliased-type"]' 'Aliased type' +//@ has - '//*[@class="sidebar-elems"]//h3/a[@href="#aliased-type"]' 'Aliased type' // We check that we have the implementation of the type alias itself. -// @has - '//*[@id="impl-GenericStruct%3Cu8%3E"]/h3' 'impl TypedefStruct' -// @has - '//*[@id="method.on_alias"]/h4' 'pub fn on_alias()' +//@ has - '//*[@id="impl-GenericStruct%3Cu8%3E"]/h3' 'impl TypedefStruct' +//@ has - '//*[@id="method.on_alias"]/h4' 'pub fn on_alias()' // This trait implementation doesn't match the type alias parameters so shouldn't appear in docs. -// @!has - '//h3' 'impl Bar for GenericStruct<u32> {}' +//@ !has - '//h3' 'impl Bar for GenericStruct<u32> {}' // Same goes for the `Deref` impl. -// @!has - '//h2' 'Methods from Deref<Target = u32>' -// @count - '//nav[@class="sidebar"]//a' 'on_alias' 1 -// @!has - '//nav[@class="sidebar"]//a' 'on_gen' -// @!has - '//nav[@class="sidebar"]//a' 'Foo' -// @!has - '//nav[@class="sidebar"]//a' 'Bar' -// @!has - '//nav[@class="sidebar"]//a' 'on_u32' +//@ !has - '//h2' 'Methods from Deref<Target = u32>' +//@ count - '//nav[@class="sidebar"]//a' 'on_alias' 1 +//@ !has - '//nav[@class="sidebar"]//a' 'on_gen' +//@ !has - '//nav[@class="sidebar"]//a' 'Foo' +//@ !has - '//nav[@class="sidebar"]//a' 'Bar' +//@ !has - '//nav[@class="sidebar"]//a' 'on_u32' // TypedefStruct inlined to GenericStruct -// @hasraw 'type.impl/foo/struct.GenericStruct.js' 'TypedefStruct' -// @hasraw 'type.impl/foo/struct.GenericStruct.js' 'method.on_gen' -// @hasraw 'type.impl/foo/struct.GenericStruct.js' 'Foo' +//@ hasraw 'type.impl/foo/struct.GenericStruct.js' 'TypedefStruct' +//@ hasraw 'type.impl/foo/struct.GenericStruct.js' 'method.on_gen' +//@ hasraw 'type.impl/foo/struct.GenericStruct.js' 'Foo' pub type TypedefStruct = GenericStruct<u8>; impl TypedefStruct { @@ -53,12 +53,12 @@ impl std::ops::Deref for GenericStruct<u32> { pub struct Wrap<T>(GenericStruct<T>); -// @has 'foo/type.Alias.html' -// @!has - '//h2' 'Methods from Deref<Target = u32>' -// @!has - '//*[@id="impl-Deref-for-Wrap%3CT%3E"]/h3' 'impl<T> Deref for Wrap<T>' -// @hasraw 'type.impl/foo/struct.Wrap.js' 'impl-Deref-for-Wrap%3CT%3E' +//@ has 'foo/type.Alias.html' +//@ !has - '//h2' 'Methods from Deref<Target = u32>' +//@ !has - '//*[@id="impl-Deref-for-Wrap%3CT%3E"]/h3' 'impl<T> Deref for Wrap<T>' +//@ hasraw 'type.impl/foo/struct.Wrap.js' 'impl-Deref-for-Wrap%3CT%3E' // Deref Methods aren't gathered for type aliases, though the actual impl is. -// @!hasraw 'type.impl/foo/struct.Wrap.js' 'BITS' +//@ !hasraw 'type.impl/foo/struct.Wrap.js' 'BITS' pub type Alias = Wrap<u32>; impl<T> std::ops::Deref for Wrap<T> { diff --git a/tests/rustdoc/type-alias/primitive-local-link-121106.rs b/tests/rustdoc/type-alias/primitive-local-link-121106.rs index c11d35d8646..3bdce3846c8 100644 --- a/tests/rustdoc/type-alias/primitive-local-link-121106.rs +++ b/tests/rustdoc/type-alias/primitive-local-link-121106.rs @@ -2,18 +2,18 @@ #![feature(rustc_attrs)] -// @has foo/primitive.i32.html '//h1' 'Primitive Type i32' -// @has foo/index.html '//a/@href' '../foo/index.html' +//@ has foo/primitive.i32.html '//h1' 'Primitive Type i32' +//@ has foo/index.html '//a/@href' '../foo/index.html' #[rustc_doc_primitive = "i32"] mod i32 {} -// @has foo/struct.Node.html '//a/@href' 'primitive.i32.html' +//@ has foo/struct.Node.html '//a/@href' 'primitive.i32.html' pub struct Node; impl Node { pub fn edge(&self) -> i32 { 0 } } -// @!has foo/type.Alias.html '//a/@href' 'primitive.i32.html' -// @hasraw 'type.impl/foo/struct.Node.js' 'href=\"foo/primitive.i32.html\"' +//@ !has foo/type.Alias.html '//a/@href' 'primitive.i32.html' +//@ hasraw 'type.impl/foo/struct.Node.js' 'href=\"foo/primitive.i32.html\"' pub type Alias = Node; diff --git a/tests/rustdoc/type-alias/same-crate-115718.rs b/tests/rustdoc/type-alias/same-crate-115718.rs index 26e5db85cd6..ec847756822 100644 --- a/tests/rustdoc/type-alias/same-crate-115718.rs +++ b/tests/rustdoc/type-alias/same-crate-115718.rs @@ -27,8 +27,8 @@ impl MyTrait2 for MyStruct<u16> { fn method_trait_2() {} } -// @hasraw 'type.impl/foo/struct.MyStruct.js' 'method_u16' -// @!hasraw 'type.impl/foo/struct.MyStruct.js' 'method_u32' -// @!hasraw 'type.impl/foo/struct.MyStruct.js' 'method_trait_1' -// @hasraw 'type.impl/foo/struct.MyStruct.js' 'method_trait_2' +//@ hasraw 'type.impl/foo/struct.MyStruct.js' 'method_u16' +//@ !hasraw 'type.impl/foo/struct.MyStruct.js' 'method_u32' +//@ !hasraw 'type.impl/foo/struct.MyStruct.js' 'method_trait_1' +//@ hasraw 'type.impl/foo/struct.MyStruct.js' 'method_trait_2' pub type MyType = MyStruct<u16>; diff --git a/tests/rustdoc/type-layout-flag-required.rs b/tests/rustdoc/type-layout-flag-required.rs index 6bb5e10f881..699be973e90 100644 --- a/tests/rustdoc/type-layout-flag-required.rs +++ b/tests/rustdoc/type-layout-flag-required.rs @@ -1,4 +1,4 @@ // Tests that `--show-type-layout` is required in order to show layout info. -// @!hasraw type_layout_flag_required/struct.Foo.html 'Size: ' +//@ !hasraw type_layout_flag_required/struct.Foo.html 'Size: ' pub struct Foo(usize); diff --git a/tests/rustdoc/type-layout.rs b/tests/rustdoc/type-layout.rs index b2ff4add63e..1e462210cba 100644 --- a/tests/rustdoc/type-layout.rs +++ b/tests/rustdoc/type-layout.rs @@ -1,93 +1,93 @@ //@ compile-flags: --show-type-layout -Z unstable-options -// @hasraw type_layout/struct.Foo.html 'Size: ' -// @hasraw - ' bytes' -// @has - '//*[@id="layout"]/a[@href="#layout"]' '' +//@ hasraw type_layout/struct.Foo.html 'Size: ' +//@ hasraw - ' bytes' +//@ has - '//*[@id="layout"]/a[@href="#layout"]' '' pub struct Foo { pub a: usize, b: Vec<String>, } -// @hasraw type_layout/enum.Bar.html 'Size: ' -// @hasraw - ' bytes' +//@ hasraw type_layout/enum.Bar.html 'Size: ' +//@ hasraw - ' bytes' pub enum Bar<'a> { A(String), B(&'a str, (std::collections::HashMap<String, usize>, Foo)), } -// @hasraw type_layout/union.Baz.html 'Size: ' -// @hasraw - ' bytes' +//@ hasraw type_layout/union.Baz.html 'Size: ' +//@ hasraw - ' bytes' pub union Baz { a: &'static str, b: usize, c: &'static [u8], } -// @hasraw type_layout/struct.X.html 'Size: ' -// @hasraw - ' bytes' +//@ hasraw type_layout/struct.X.html 'Size: ' +//@ hasraw - ' bytes' pub struct X(usize); -// @hasraw type_layout/struct.Y.html 'Size: ' -// @hasraw - '1 byte' -// @!hasraw - ' bytes' +//@ hasraw type_layout/struct.Y.html 'Size: ' +//@ hasraw - '1 byte' +//@ !hasraw - ' bytes' pub struct Y(u8); -// @hasraw type_layout/struct.Z.html 'Size: ' -// @hasraw - '0 bytes' +//@ hasraw type_layout/struct.Z.html 'Size: ' +//@ hasraw - '0 bytes' pub struct Z; // We can't compute layout for generic types. -// @hasraw type_layout/struct.Generic.html 'Unable to compute type layout, possibly due to this type having generic parameters' -// @!hasraw - 'Size: ' +//@ hasraw type_layout/struct.Generic.html 'Unable to compute type layout, possibly due to this type having generic parameters' +//@ !hasraw - 'Size: ' pub struct Generic<T>(T); // We *can*, however, compute layout for types that are only generic over lifetimes, // because lifetimes are a type-system construct. -// @hasraw type_layout/struct.GenericLifetimes.html 'Size: ' -// @hasraw - ' bytes' +//@ hasraw type_layout/struct.GenericLifetimes.html 'Size: ' +//@ hasraw - ' bytes' pub struct GenericLifetimes<'a>(&'a str); -// @hasraw type_layout/struct.Unsized.html 'Size: ' -// @hasraw - '(unsized)' +//@ hasraw type_layout/struct.Unsized.html 'Size: ' +//@ hasraw - '(unsized)' pub struct Unsized([u8]); -// @hasraw type_layout/type.TypeAlias.html 'Size: ' -// @hasraw - ' bytes' +//@ hasraw type_layout/type.TypeAlias.html 'Size: ' +//@ hasraw - ' bytes' pub type TypeAlias = X; -// @hasraw type_layout/type.GenericTypeAlias.html 'Size: ' -// @hasraw - '8 bytes' +//@ hasraw type_layout/type.GenericTypeAlias.html 'Size: ' +//@ hasraw - '8 bytes' pub type GenericTypeAlias = (Generic<(u32, ())>, Generic<u32>); // Regression test for the rustdoc equivalent of #85103. -// @hasraw type_layout/type.Edges.html 'Encountered an error during type layout; the type failed to be normalized.' +//@ hasraw type_layout/type.Edges.html 'Encountered an error during type layout; the type failed to be normalized.' pub type Edges<'a, E> = std::borrow::Cow<'a, [E]>; -// @!hasraw type_layout/trait.MyTrait.html 'Size: ' +//@ !hasraw type_layout/trait.MyTrait.html 'Size: ' pub trait MyTrait {} -// @hasraw type_layout/enum.Variants.html 'Size: ' -// @hasraw - '2 bytes' -// @hasraw - '<code>A</code>: 0 bytes' -// @hasraw - '<code>B</code>: 1 byte' +//@ hasraw type_layout/enum.Variants.html 'Size: ' +//@ hasraw - '2 bytes' +//@ hasraw - '<code>A</code>: 0 bytes' +//@ hasraw - '<code>B</code>: 1 byte' pub enum Variants { A, B(u8), } -// @hasraw type_layout/enum.WithNiche.html 'Size: ' -// @has - //p '4 bytes' -// @hasraw - '<code>None</code>: 0 bytes' -// @hasraw - '<code>Some</code>: 4 bytes' +//@ hasraw type_layout/enum.WithNiche.html 'Size: ' +//@ has - //p '4 bytes' +//@ hasraw - '<code>None</code>: 0 bytes' +//@ hasraw - '<code>Some</code>: 4 bytes' pub enum WithNiche { None, Some(std::num::NonZero<u32>), } -// @hasraw type_layout/enum.Uninhabited.html 'Size: ' -// @hasraw - '0 bytes (<a href="https://doc.rust-lang.org/stable/reference/glossary.html#uninhabited">uninhabited</a>)' +//@ hasraw type_layout/enum.Uninhabited.html 'Size: ' +//@ hasraw - '0 bytes (<a href="https://doc.rust-lang.org/stable/reference/glossary.html#uninhabited">uninhabited</a>)' pub enum Uninhabited {} -// @hasraw type_layout/struct.Uninhabited2.html 'Size: ' -// @hasraw - '8 bytes (<a href="https://doc.rust-lang.org/stable/reference/glossary.html#uninhabited">uninhabited</a>)' +//@ hasraw type_layout/struct.Uninhabited2.html 'Size: ' +//@ hasraw - '8 bytes (<a href="https://doc.rust-lang.org/stable/reference/glossary.html#uninhabited">uninhabited</a>)' pub struct Uninhabited2(std::convert::Infallible, u64); diff --git a/tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs b/tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs index bea25c75aa4..c6bfe495bb0 100644 --- a/tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs +++ b/tests/rustdoc/typedef-inner-variants-lazy_type_alias.rs @@ -3,32 +3,32 @@ #![feature(lazy_type_alias)] #![allow(incomplete_features)] -// @has 'inner_types_lazy/struct.Pair.html' +//@ has 'inner_types_lazy/struct.Pair.html' pub struct Pair<A, B> { pub first: A, pub second: B, } -// @has 'inner_types_lazy/type.ReversedTypesPair.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 0 -// @count - '//*[@id="fields"]' 1 -// @count - '//div[@class="where"]' 0 +//@ has 'inner_types_lazy/type.ReversedTypesPair.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 0 +//@ count - '//*[@id="fields"]' 1 +//@ count - '//div[@class="where"]' 0 pub type ReversedTypesPair<Q, R> = Pair<R, Q>; -// @has 'inner_types_lazy/type.ReadWrite.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 0 -// @count - '//*[@id="fields"]' 1 -// @count - '//div[@class="where"]' 2 +//@ has 'inner_types_lazy/type.ReadWrite.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 0 +//@ count - '//*[@id="fields"]' 1 +//@ count - '//div[@class="where"]' 2 pub type ReadWrite<R, W> = Pair<R, W> where R: std::io::Read, W: std::io::Write; -// @has 'inner_types_lazy/type.VecPair.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 0 -// @count - '//*[@id="fields"]' 1 -// @count - '//div[@class="where"]' 0 +//@ has 'inner_types_lazy/type.VecPair.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 0 +//@ count - '//*[@id="fields"]' 1 +//@ count - '//div[@class="where"]' 0 pub type VecPair<U, V> = Pair<Vec<U>, Vec<V>>; diff --git a/tests/rustdoc/typedef-inner-variants.rs b/tests/rustdoc/typedef-inner-variants.rs index 0e65fdaf2af..51644546c01 100644 --- a/tests/rustdoc/typedef-inner-variants.rs +++ b/tests/rustdoc/typedef-inner-variants.rs @@ -20,12 +20,12 @@ impl Interner for TyCtxt { type Ty = Ty; } -// @has 'inner_variants/type.AliasTy.html' -// @count - '//*[@id="variants"]' 0 -// @count - '//*[@id="fields"]' 0 +//@ has 'inner_variants/type.AliasTy.html' +//@ count - '//*[@id="variants"]' 0 +//@ count - '//*[@id="fields"]' 0 pub type AliasTy = Ty; -// @has 'inner_variants/enum.IrTyKind.html' +//@ has 'inner_variants/enum.IrTyKind.html' pub enum IrTyKind<A, I: Interner> { /// Doc comment for AdtKind AdtKind(I::Adt), @@ -37,39 +37,39 @@ pub enum IrTyKind<A, I: Interner> { Unspecified, } -// @has 'inner_variants/type.NearlyTyKind.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 1 -// @count - '//*[@id="fields"]' 0 +//@ has 'inner_variants/type.NearlyTyKind.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 1 +//@ count - '//*[@id="fields"]' 0 pub type NearlyTyKind<A> = IrTyKind<A, TyCtxt>; -// @has 'inner_variants/type.TyKind.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 1 -// @count - '//*[@id="fields"]' 0 -// @count - '//*[@class="variant"]' 3 -// @matches - '//pre[@class="rust item-decl"]//code' "enum TyKind" -// @has - '//pre[@class="rust item-decl"]//code/a[1]' "Adt" -// @has - '//pre[@class="rust item-decl"]//code/a[2]' "Adt" -// @has - '//pre[@class="rust item-decl"]//code/a[3]' "Ty" -// @has - '//pre[@class="rust item-decl"]//code/a[4]' "i64" +//@ has 'inner_variants/type.TyKind.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 1 +//@ count - '//*[@id="fields"]' 0 +//@ count - '//*[@class="variant"]' 3 +//@ matches - '//pre[@class="rust item-decl"]//code' "enum TyKind" +//@ has - '//pre[@class="rust item-decl"]//code/a[1]' "Adt" +//@ has - '//pre[@class="rust item-decl"]//code/a[2]' "Adt" +//@ has - '//pre[@class="rust item-decl"]//code/a[3]' "Ty" +//@ has - '//pre[@class="rust item-decl"]//code/a[4]' "i64" pub type TyKind = IrTyKind<i64, TyCtxt>; -// @has 'inner_variants/union.OneOr.html' +//@ has 'inner_variants/union.OneOr.html' pub union OneOr<A: Copy> { pub one: i64, pub or: A, } -// @has 'inner_variants/type.OneOrF64.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 0 -// @count - '//*[@id="fields"]' 1 -// @count - '//*[@class="structfield section-header"]' 2 -// @matches - '//pre[@class="rust item-decl"]//code' "union OneOrF64" +//@ has 'inner_variants/type.OneOrF64.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 0 +//@ count - '//*[@id="fields"]' 1 +//@ count - '//*[@class="structfield section-header"]' 2 +//@ matches - '//pre[@class="rust item-decl"]//code' "union OneOrF64" pub type OneOrF64 = OneOr<f64>; -// @has 'inner_variants/struct.One.html' +//@ has 'inner_variants/struct.One.html' pub struct One<T> { pub val: T, #[doc(hidden)] @@ -77,50 +77,50 @@ pub struct One<T> { __private: T, } -// @has 'inner_variants/type.OneU64.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 0 -// @count - '//*[@id="fields"]' 1 -// @count - '//*[@class="structfield section-header"]' 1 -// @matches - '//pre[@class="rust item-decl"]//code' "struct OneU64" -// @matches - '//pre[@class="rust item-decl"]//code' "pub val" +//@ has 'inner_variants/type.OneU64.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 0 +//@ count - '//*[@id="fields"]' 1 +//@ count - '//*[@class="structfield section-header"]' 1 +//@ matches - '//pre[@class="rust item-decl"]//code' "struct OneU64" +//@ matches - '//pre[@class="rust item-decl"]//code' "pub val" pub type OneU64 = One<u64>; -// @has 'inner_variants/struct.OnceA.html' +//@ has 'inner_variants/struct.OnceA.html' pub struct OnceA<'a, A> { pub a: &'a A, } -// @has 'inner_variants/type.Once.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 0 -// @count - '//*[@id="fields"]' 1 -// @matches - '//pre[@class="rust item-decl"]//code' "struct Once<'a>" -// @matches - '//pre[@class="rust item-decl"]//code' "&'a" +//@ has 'inner_variants/type.Once.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 0 +//@ count - '//*[@id="fields"]' 1 +//@ matches - '//pre[@class="rust item-decl"]//code' "struct Once<'a>" +//@ matches - '//pre[@class="rust item-decl"]//code' "&'a" pub type Once<'a> = OnceA<'a, i64>; -// @has 'inner_variants/struct.HighlyGenericStruct.html' +//@ has 'inner_variants/struct.HighlyGenericStruct.html' pub struct HighlyGenericStruct<A, B, C, D> { pub z: (A, B, C, D) } -// @has 'inner_variants/type.HighlyGenericAABB.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 0 -// @count - '//*[@id="fields"]' 1 -// @matches - '//pre[@class="rust item-decl"]//code' "struct HighlyGenericAABB<A, B>" -// @matches - '//pre[@class="rust item-decl"]//code' "pub z" +//@ has 'inner_variants/type.HighlyGenericAABB.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 0 +//@ count - '//*[@id="fields"]' 1 +//@ matches - '//pre[@class="rust item-decl"]//code' "struct HighlyGenericAABB<A, B>" +//@ matches - '//pre[@class="rust item-decl"]//code' "pub z" pub type HighlyGenericAABB<A, B> = HighlyGenericStruct<A, A, B, B>; -// @has 'inner_variants/type.InlineU64.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 0 -// @count - '//*[@id="fields"]' 1 +//@ has 'inner_variants/type.InlineU64.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 0 +//@ count - '//*[@id="fields"]' 1 pub use cross_crate_generic_typedef::InlineU64; -// @has 'inner_variants/type.InlineEnum.html' -// @count - '//*[@id="aliased-type"]' 1 -// @count - '//*[@id="variants"]' 1 -// @count - '//*[@id="fields"]' 0 -// @count - '//*[@class="variant"]' 2 +//@ has 'inner_variants/type.InlineEnum.html' +//@ count - '//*[@id="aliased-type"]' 1 +//@ count - '//*[@id="variants"]' 1 +//@ count - '//*[@id="fields"]' 0 +//@ count - '//*[@class="variant"]' 2 pub type InlineEnum = cross_crate_generic_typedef::GenericEnum<i32>; diff --git a/tests/rustdoc/typedef.rs b/tests/rustdoc/typedef.rs index 63e2973c759..3fdc2788bca 100644 --- a/tests/rustdoc/typedef.rs +++ b/tests/rustdoc/typedef.rs @@ -8,13 +8,13 @@ impl MyStruct { pub fn method_on_mystruct() {} } -// @has typedef/type.MyAlias.html -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'impl MyAlias' -// @has - '//*[@class="impl"]//h3[@class="code-header"]' 'impl MyTrait for MyAlias' -// @hasraw - 'Alias docstring' -// @has - '//*[@class="sidebar"]//*[@class="location"]' 'MyAlias' -// @has - '//*[@class="sidebar"]//a[@href="#implementations"]' 'Methods' -// @has - '//*[@class="sidebar"]//a[@href="#trait-implementations"]' 'Trait Implementations' +//@ has typedef/type.MyAlias.html +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'impl MyAlias' +//@ has - '//*[@class="impl"]//h3[@class="code-header"]' 'impl MyTrait for MyAlias' +//@ hasraw - 'Alias docstring' +//@ has - '//*[@class="sidebar"]//*[@class="location"]' 'MyAlias' +//@ has - '//*[@class="sidebar"]//a[@href="#implementations"]' 'Methods' +//@ has - '//*[@class="sidebar"]//a[@href="#trait-implementations"]' 'Trait Implementations' /// Alias docstring pub type MyAlias = MyStruct; diff --git a/tests/rustdoc/underscore-import-61592.rs b/tests/rustdoc/underscore-import-61592.rs index d403f2cc7ab..d0fef96858a 100644 --- a/tests/rustdoc/underscore-import-61592.rs +++ b/tests/rustdoc/underscore-import-61592.rs @@ -4,14 +4,14 @@ extern crate foo; -// @has bar/index.html -// @has - '//a[@href="#reexports"]' 'Re-exports' -// @has - '//code' 'pub use foo::FooTrait as _;' -// @!has - '//a[@href="trait._.html"]' '' +//@ has bar/index.html +//@ has - '//a[@href="#reexports"]' 'Re-exports' +//@ has - '//code' 'pub use foo::FooTrait as _;' +//@ !has - '//a[@href="trait._.html"]' '' pub use foo::FooTrait as _; -// @has bar/index.html -// @has - '//a[@href="#reexports"]' 'Re-exports' -// @has - '//code' 'pub use foo::FooStruct as _;' -// @!has - '//a[@href="struct._.html"]' '' +//@ has bar/index.html +//@ has - '//a[@href="#reexports"]' 'Re-exports' +//@ has - '//code' 'pub use foo::FooStruct as _;' +//@ !has - '//a[@href="struct._.html"]' '' pub use foo::FooStruct as _; diff --git a/tests/rustdoc/unindent.rs b/tests/rustdoc/unindent.rs index 372af5f4672..f9787b076c1 100644 --- a/tests/rustdoc/unindent.rs +++ b/tests/rustdoc/unindent.rs @@ -1,7 +1,7 @@ #![crate_name = "foo"] -// @has foo/struct.Example.html -// @matches - '//pre[@class="rust rust-example-rendered"]' \ +//@ has foo/struct.Example.html +//@ matches - '//pre[@class="rust rust-example-rendered"]' \ // '(?m)let example = Example::new\(\)\n \.first\(\)\n \.second\(\)\n \.build\(\);\Z' /// ```rust /// let example = Example::new() @@ -11,8 +11,8 @@ /// ``` pub struct Example; -// @has foo/struct.F.html -// @matches - '//pre[@class="rust rust-example-rendered"]' \ +//@ has foo/struct.F.html +//@ matches - '//pre[@class="rust rust-example-rendered"]' \ // '(?m)let example = Example::new\(\)\n \.first\(\)\n \.another\(\)\n \.build\(\);\Z' ///```rust ///let example = Example::new() @@ -22,8 +22,8 @@ pub struct Example; /// ``` pub struct F; -// @has foo/struct.G.html -// @matches - '//pre[@class="rust rust-example-rendered"]' \ +//@ has foo/struct.G.html +//@ matches - '//pre[@class="rust rust-example-rendered"]' \ // '(?m)let example = Example::new\(\)\n\.first\(\)\n \.another\(\)\n\.build\(\);\Z' ///```rust ///let example = Example::new() @@ -33,27 +33,27 @@ pub struct F; ///``` pub struct G; -// @has foo/struct.H.html -// @has - '//div[@class="docblock"]/p' 'no whitespace lol' +//@ has foo/struct.H.html +//@ has - '//div[@class="docblock"]/p' 'no whitespace lol' ///no whitespace #[doc = " lol"] pub struct H; -// @has foo/struct.I.html -// @matches - '//pre[@class="rust rust-example-rendered"]' '(?m)4 whitespaces!\Z' +//@ has foo/struct.I.html +//@ matches - '//pre[@class="rust rust-example-rendered"]' '(?m)4 whitespaces!\Z' /// 4 whitespaces! #[doc = "something"] pub struct I; -// @has foo/struct.J.html -// @matches - '//div[@class="docblock"]/p' '(?m)a\nno whitespace\nJust some text.\Z' +//@ has foo/struct.J.html +//@ matches - '//div[@class="docblock"]/p' '(?m)a\nno whitespace\nJust some text.\Z' ///a ///no whitespace #[doc = include_str!("unindent.md")] pub struct J; -// @has foo/struct.K.html -// @matches - '//pre[@class="rust rust-example-rendered"]' '(?m)4 whitespaces!\Z' +//@ has foo/struct.K.html +//@ matches - '//pre[@class="rust rust-example-rendered"]' '(?m)4 whitespaces!\Z' ///a /// /// 4 whitespaces! diff --git a/tests/rustdoc/union-fields-html.rs b/tests/rustdoc/union-fields-html.rs index 1ac01232c3e..8550980b896 100644 --- a/tests/rustdoc/union-fields-html.rs +++ b/tests/rustdoc/union-fields-html.rs @@ -1,9 +1,9 @@ #![crate_name = "foo"] -// @has 'foo/union.Union.html' +//@ has 'foo/union.Union.html' // Checking that there is a whitespace after `:`. -// @has - '//*[@id="structfield.a"]/code' 'a: u8' -// @has - '//*[@id="structfield.b"]/code' 'b: u32' +//@ has - '//*[@id="structfield.a"]/code' 'a: u8' +//@ has - '//*[@id="structfield.b"]/code' 'b: u32' pub union Union { pub a: u8, /// tadam diff --git a/tests/rustdoc/union.rs b/tests/rustdoc/union.rs index 5a788eb1b1c..a3c046ec7c1 100644 --- a/tests/rustdoc/union.rs +++ b/tests/rustdoc/union.rs @@ -1,8 +1,8 @@ -// @has union/union.U.html +//@ has union/union.U.html pub union U { - // @has - //pre "pub a: u8" + //@ has - //pre "pub a: u8" pub a: u8, - // @has - //pre "/* private fields */" - // @!has - //pre "b: u16" + //@ has - //pre "/* private fields */" + //@ !has - //pre "b: u16" b: u16, } diff --git a/tests/rustdoc/unit-return.rs b/tests/rustdoc/unit-return.rs index 47a3e6d490b..2b3e6414ae5 100644 --- a/tests/rustdoc/unit-return.rs +++ b/tests/rustdoc/unit-return.rs @@ -4,14 +4,14 @@ extern crate unit_return; -// @has 'foo/fn.f0.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u8) + Clone' +//@ has 'foo/fn.f0.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u8) + Clone' pub fn f0<F: FnMut(u8) + Clone>(f: F) {} -// @has 'foo/fn.f1.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u16) + Clone' +//@ has 'foo/fn.f1.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u16) + Clone' pub fn f1<F: FnMut(u16) -> () + Clone>(f: F) {} -// @has 'foo/fn.f2.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u32) + Clone' +//@ has 'foo/fn.f2.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u32) + Clone' pub use unit_return::f2; -// @has 'foo/fn.f3.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u64) + Clone' +//@ has 'foo/fn.f3.html' '//pre[@class="rust item-decl"]' 'F: FnMut(u64) + Clone' pub use unit_return::f3; diff --git a/tests/rustdoc/universal-impl-trait.rs b/tests/rustdoc/universal-impl-trait.rs index f5eabda59b7..b78d69c0690 100644 --- a/tests/rustdoc/universal-impl-trait.rs +++ b/tests/rustdoc/universal-impl-trait.rs @@ -3,17 +3,17 @@ use std::io::Read; use std::borrow::Borrow; -// @has foo/fn.foo.html -// @has - //pre 'foo(' -// @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Clone\.html"' -// @matchesraw - '_z: .+impl.+trait\.Copy\.html.+, impl.+trait\.Clone\.html' +//@ has foo/fn.foo.html +//@ has - //pre 'foo(' +//@ matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Clone\.html"' +//@ matchesraw - '_z: .+impl.+trait\.Copy\.html.+, impl.+trait\.Clone\.html' pub fn foo(_x: impl Clone, _y: i32, _z: (impl Copy, impl Clone)) { } pub trait Trait { - // @has foo/trait.Trait.html - // @hasraw - 'method</a>(' - // @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"' + //@ has foo/trait.Trait.html + //@ hasraw - 'method</a>(' + //@ matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"' fn method(&self, _x: impl std::fmt::Debug) { } } @@ -21,31 +21,31 @@ pub trait Trait { pub struct S<T>(T); impl<T> S<T> { - // @has foo/struct.S.html - // @hasraw - 'bar</a>(' - // @matchesraw - '_bar: impl <a class="trait" href="[^"]+/trait\.Copy\.html"' + //@ has foo/struct.S.html + //@ hasraw - 'bar</a>(' + //@ matchesraw - '_bar: impl <a class="trait" href="[^"]+/trait\.Copy\.html"' pub fn bar(_bar: impl Copy) { } - // @hasraw - 'baz</a>(' - // @matchesraw - '_baz:.+struct\.S\.html.+impl .+trait\.Clone\.html' + //@ hasraw - 'baz</a>(' + //@ matchesraw - '_baz:.+struct\.S\.html.+impl .+trait\.Clone\.html' pub fn baz(_baz: S<impl Clone>) { } - // @hasraw - 'qux</a>(' - // @matchesraw - 'trait\.Read\.html' + //@ hasraw - 'qux</a>(' + //@ matchesraw - 'trait\.Read\.html' pub fn qux(_qux: impl IntoIterator<Item = S<impl Read>>) { } } -// @hasraw - 'method</a>(' -// @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"' +//@ hasraw - 'method</a>(' +//@ matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"' impl<T> Trait for S<T> {} -// @has foo/fn.much_universe.html -// @matchesraw - 'T:.+Borrow.+impl .+trait\.Trait\.html' -// @matchesraw - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html' -// @matchesraw - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html' +//@ has foo/fn.much_universe.html +//@ matchesraw - 'T:.+Borrow.+impl .+trait\.Trait\.html' +//@ matchesraw - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html' +//@ matchesraw - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html' pub fn much_universe< T: Borrow<impl Trait>, U: IntoIterator<Item = impl Iterator<Item = impl Clone>>, diff --git a/tests/rustdoc/unneeded-trait-implementations-title.rs b/tests/rustdoc/unneeded-trait-implementations-title.rs index e1bcfd3b97e..f7a97dfaaef 100644 --- a/tests/rustdoc/unneeded-trait-implementations-title.rs +++ b/tests/rustdoc/unneeded-trait-implementations-title.rs @@ -2,4 +2,4 @@ pub struct Bar; -// @count foo/struct.Bar.html '//*[@id="implementations"]' 0 +//@ count foo/struct.Bar.html '//*[@id="implementations"]' 0 diff --git a/tests/rustdoc/use-attr.rs b/tests/rustdoc/use-attr.rs index 68e44bdfdc4..82d696991a6 100644 --- a/tests/rustdoc/use-attr.rs +++ b/tests/rustdoc/use-attr.rs @@ -2,7 +2,7 @@ // ICE when rustdoc encountered a use statement of a non-macro attribute (see #58054) -// @has use_attr/index.html -// @has - '//code' 'pub use proc_macro_attribute' +//@ has use_attr/index.html +//@ has - '//code' 'pub use proc_macro_attribute' pub use proc_macro_attribute; use proc_macro_derive; diff --git a/tests/rustdoc/useless_lifetime_bound.rs b/tests/rustdoc/useless_lifetime_bound.rs index f530d8a654f..68d55eec10c 100644 --- a/tests/rustdoc/useless_lifetime_bound.rs +++ b/tests/rustdoc/useless_lifetime_bound.rs @@ -1,13 +1,13 @@ use std::marker::PhantomData; -// @has useless_lifetime_bound/struct.Scope.html -// @!has - '//*[@class="rust struct"]' "'env: 'env" +//@ has useless_lifetime_bound/struct.Scope.html +//@ !has - '//*[@class="rust struct"]' "'env: 'env" pub struct Scope<'env> { _marker: PhantomData<&'env mut &'env ()>, } -// @has useless_lifetime_bound/struct.Scope.html -// @!has - '//*[@class="rust struct"]' "T: 'a + 'a" +//@ has useless_lifetime_bound/struct.Scope.html +//@ !has - '//*[@class="rust struct"]' "T: 'a + 'a" pub struct SomeStruct<'a, T: 'a> { _marker: PhantomData<&'a T>, } diff --git a/tests/rustdoc/variadic.rs b/tests/rustdoc/variadic.rs index bd8f1775b3d..8bf40464eff 100644 --- a/tests/rustdoc/variadic.rs +++ b/tests/rustdoc/variadic.rs @@ -1,4 +1,4 @@ extern "C" { - // @has variadic/fn.foo.html //pre 'pub unsafe extern "C" fn foo(x: i32, ...)' + //@ has variadic/fn.foo.html //pre 'pub unsafe extern "C" fn foo(x: i32, ...)' pub fn foo(x: i32, ...); } diff --git a/tests/rustdoc/version-separator-without-source.rs b/tests/rustdoc/version-separator-without-source.rs index 4a855b7bb29..e439681484c 100644 --- a/tests/rustdoc/version-separator-without-source.rs +++ b/tests/rustdoc/version-separator-without-source.rs @@ -3,21 +3,21 @@ #![stable(feature = "bar", since = "1.0")] #![crate_name = "foo"] -// @has foo/fn.foo.html -// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · ' -// @!has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' +//@ has foo/fn.foo.html +//@ has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · ' +//@ !has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' #[stable(feature = "bar", since = "1.0")] pub fn foo() {} -// @has foo/struct.Bar.html -// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · ' -// @!has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' +//@ has foo/struct.Bar.html +//@ has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · ' +//@ !has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0.0 · source · ' #[stable(feature = "bar", since = "1.0")] pub struct Bar; impl Bar { - // @has - '//*[@id="method.bar"]/*[@class="since rightside"]' '2.0.0' - // @!has - '//*[@id="method.bar"]/*[@class="rightside"]' '2.0.0 ·' + //@ has - '//*[@id="method.bar"]/*[@class="since rightside"]' '2.0.0' + //@ !has - '//*[@id="method.bar"]/*[@class="rightside"]' '2.0.0 ·' #[stable(feature = "foobar", since = "2.0")] pub fn bar() {} } diff --git a/tests/rustdoc/viewpath-rename.rs b/tests/rustdoc/viewpath-rename.rs index 54612763792..c2dcd1033b6 100644 --- a/tests/rustdoc/viewpath-rename.rs +++ b/tests/rustdoc/viewpath-rename.rs @@ -9,13 +9,13 @@ pub enum Maybe<A> { Nothing } -// @has foo/prelude/index.html +//@ has foo/prelude/index.html pub mod prelude { - // @has foo/prelude/index.html '//code' 'pub use io as FooIo;' - // @has foo/prelude/index.html '//code' 'pub use io::Reader as FooReader;' + //@ has foo/prelude/index.html '//code' 'pub use io as FooIo;' + //@ has foo/prelude/index.html '//code' 'pub use io::Reader as FooReader;' #[doc(no_inline)] pub use io::{self as FooIo, Reader as FooReader}; - // @has foo/prelude/index.html '//code' 'pub use Maybe;' - // @has foo/prelude/index.html '//code' 'pub use Maybe::Just as MaybeJust;' - // @has foo/prelude/index.html '//code' 'pub use Maybe::Nothing;' + //@ has foo/prelude/index.html '//code' 'pub use Maybe;' + //@ has foo/prelude/index.html '//code' 'pub use Maybe::Just as MaybeJust;' + //@ has foo/prelude/index.html '//code' 'pub use Maybe::Nothing;' #[doc(no_inline)] pub use Maybe::{self, Just as MaybeJust, Nothing}; } diff --git a/tests/rustdoc/viewpath-self.rs b/tests/rustdoc/viewpath-self.rs index a6b6592955f..5e998be6abe 100644 --- a/tests/rustdoc/viewpath-self.rs +++ b/tests/rustdoc/viewpath-self.rs @@ -9,13 +9,13 @@ pub enum Maybe<A> { Nothing } -// @has foo/prelude/index.html +//@ has foo/prelude/index.html pub mod prelude { - // @has foo/prelude/index.html '//code' 'pub use io;' - // @has foo/prelude/index.html '//code' 'pub use io::Reader;' + //@ has foo/prelude/index.html '//code' 'pub use io;' + //@ has foo/prelude/index.html '//code' 'pub use io::Reader;' #[doc(no_inline)] pub use io::{self, Reader}; - // @has foo/prelude/index.html '//code' 'pub use Maybe;' - // @has foo/prelude/index.html '//code' 'pub use Maybe::Just;' - // @has foo/prelude/index.html '//code' 'pub use Maybe::Nothing;' + //@ has foo/prelude/index.html '//code' 'pub use Maybe;' + //@ has foo/prelude/index.html '//code' 'pub use Maybe::Just;' + //@ has foo/prelude/index.html '//code' 'pub use Maybe::Nothing;' #[doc(no_inline)] pub use Maybe::{self, Just, Nothing}; } diff --git a/tests/rustdoc/visibility.rs b/tests/rustdoc/visibility.rs index 87ac9a9b74d..b6a757e5047 100644 --- a/tests/rustdoc/visibility.rs +++ b/tests/rustdoc/visibility.rs @@ -4,83 +4,83 @@ #![feature(inherent_associated_types)] #![allow(incomplete_features)] -// @!has 'foo/index.html' '//a[@href="struct.FooPublic.html"]/..' 'FooPublic 🔒' -// @has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic' +//@ !has 'foo/index.html' '//a[@href="struct.FooPublic.html"]/..' 'FooPublic 🔒' +//@ has 'foo/struct.FooPublic.html' '//pre' 'pub struct FooPublic' pub struct FooPublic; -// @has 'foo/index.html' '//a[@href="struct.FooJustCrate.html"]/..' 'FooJustCrate 🔒' -// @has 'foo/struct.FooJustCrate.html' '//pre' 'pub(crate) struct FooJustCrate' +//@ has 'foo/index.html' '//a[@href="struct.FooJustCrate.html"]/..' 'FooJustCrate 🔒' +//@ has 'foo/struct.FooJustCrate.html' '//pre' 'pub(crate) struct FooJustCrate' pub(crate) struct FooJustCrate; -// @has 'foo/index.html' '//a[@href="struct.FooPubCrate.html"]/..' 'FooPubCrate 🔒' -// @has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate' +//@ has 'foo/index.html' '//a[@href="struct.FooPubCrate.html"]/..' 'FooPubCrate 🔒' +//@ has 'foo/struct.FooPubCrate.html' '//pre' 'pub(crate) struct FooPubCrate' pub(crate) struct FooPubCrate; -// @has 'foo/index.html' '//a[@href="struct.FooSelf.html"]/..' 'FooSelf 🔒' -// @has 'foo/struct.FooSelf.html' '//pre' 'pub(crate) struct FooSelf' +//@ has 'foo/index.html' '//a[@href="struct.FooSelf.html"]/..' 'FooSelf 🔒' +//@ has 'foo/struct.FooSelf.html' '//pre' 'pub(crate) struct FooSelf' pub(self) struct FooSelf; -// @has 'foo/index.html' '//a[@href="struct.FooInSelf.html"]/..' 'FooInSelf 🔒' -// @has 'foo/struct.FooInSelf.html' '//pre' 'pub(crate) struct FooInSelf' +//@ has 'foo/index.html' '//a[@href="struct.FooInSelf.html"]/..' 'FooInSelf 🔒' +//@ has 'foo/struct.FooInSelf.html' '//pre' 'pub(crate) struct FooInSelf' pub(in self) struct FooInSelf; -// @has 'foo/index.html' '//a[@href="struct.FooPriv.html"]/..' 'FooPriv 🔒' -// @has 'foo/struct.FooPriv.html' '//pre' 'pub(crate) struct FooPriv' +//@ has 'foo/index.html' '//a[@href="struct.FooPriv.html"]/..' 'FooPriv 🔒' +//@ has 'foo/struct.FooPriv.html' '//pre' 'pub(crate) struct FooPriv' struct FooPriv; -// @!has 'foo/index.html' '//a[@href="pub_mod/index.html"]/..' 'pub_mod 🔒' +//@ !has 'foo/index.html' '//a[@href="pub_mod/index.html"]/..' 'pub_mod 🔒' pub mod pub_mod {} -// @has 'foo/index.html' '//a[@href="pub_crate_mod/index.html"]/..' 'pub_crate_mod 🔒' +//@ has 'foo/index.html' '//a[@href="pub_crate_mod/index.html"]/..' 'pub_crate_mod 🔒' pub(crate) mod pub_crate_mod {} -// @has 'foo/index.html' '//a[@href="a/index.html"]/..' 'a 🔒' +//@ has 'foo/index.html' '//a[@href="a/index.html"]/..' 'a 🔒' mod a { - // @has 'foo/a/index.html' '//a[@href="struct.FooASuper.html"]/..' 'FooASuper 🔒' - // @has 'foo/a/struct.FooASuper.html' '//pre' 'pub(crate) struct FooASuper' + //@ has 'foo/a/index.html' '//a[@href="struct.FooASuper.html"]/..' 'FooASuper 🔒' + //@ has 'foo/a/struct.FooASuper.html' '//pre' 'pub(crate) struct FooASuper' pub(super) struct FooASuper; - // @has 'foo/a/index.html' '//a[@href="struct.FooAInSuper.html"]/..' 'FooAInSuper 🔒' - // @has 'foo/a/struct.FooAInSuper.html' '//pre' 'pub(crate) struct FooAInSuper' + //@ has 'foo/a/index.html' '//a[@href="struct.FooAInSuper.html"]/..' 'FooAInSuper 🔒' + //@ has 'foo/a/struct.FooAInSuper.html' '//pre' 'pub(crate) struct FooAInSuper' pub(in super) struct FooAInSuper; - // @has 'foo/a/index.html' '//a[@href="struct.FooAInA.html"]/..' 'FooAInA 🔒' - // @has 'foo/a/struct.FooAInA.html' '//pre' 'struct FooAInA' - // @!has 'foo/a/struct.FooAInA.html' '//pre' 'pub' + //@ has 'foo/a/index.html' '//a[@href="struct.FooAInA.html"]/..' 'FooAInA 🔒' + //@ has 'foo/a/struct.FooAInA.html' '//pre' 'struct FooAInA' + //@ !has 'foo/a/struct.FooAInA.html' '//pre' 'pub' pub(in a) struct FooAInA; - // @has 'foo/a/index.html' '//a[@href="struct.FooAPriv.html"]/..' 'FooAPriv 🔒' - // @has 'foo/a/struct.FooAPriv.html' '//pre' 'struct FooAPriv' - // @!has 'foo/a/struct.FooAPriv.html' '//pre' 'pub' + //@ has 'foo/a/index.html' '//a[@href="struct.FooAPriv.html"]/..' 'FooAPriv 🔒' + //@ has 'foo/a/struct.FooAPriv.html' '//pre' 'struct FooAPriv' + //@ !has 'foo/a/struct.FooAPriv.html' '//pre' 'pub' struct FooAPriv; - // @has 'foo/a/index.html' '//a[@href="b/index.html"]/..' 'b 🔒' + //@ has 'foo/a/index.html' '//a[@href="b/index.html"]/..' 'b 🔒' mod b { - // @has 'foo/a/b/index.html' '//a[@href="struct.FooBSuper.html"]/..' 'FooBSuper 🔒' - // @has 'foo/a/b/struct.FooBSuper.html' '//pre' 'pub(super) struct FooBSuper' + //@ has 'foo/a/b/index.html' '//a[@href="struct.FooBSuper.html"]/..' 'FooBSuper 🔒' + //@ has 'foo/a/b/struct.FooBSuper.html' '//pre' 'pub(super) struct FooBSuper' pub(super) struct FooBSuper; - // @has 'foo/a/b/index.html' '//a[@href="struct.FooBInSuperSuper.html"]/..' 'FooBInSuperSuper 🔒' - // @has 'foo/a/b/struct.FooBInSuperSuper.html' '//pre' 'pub(crate) struct FooBInSuperSuper' + //@ has 'foo/a/b/index.html' '//a[@href="struct.FooBInSuperSuper.html"]/..' 'FooBInSuperSuper 🔒' + //@ has 'foo/a/b/struct.FooBInSuperSuper.html' '//pre' 'pub(crate) struct FooBInSuperSuper' pub(in super::super) struct FooBInSuperSuper; - // @has 'foo/a/b/index.html' '//a[@href="struct.FooBInAB.html"]/..' 'FooBInAB 🔒' - // @has 'foo/a/b/struct.FooBInAB.html' '//pre' 'struct FooBInAB' - // @!has 'foo/a/b/struct.FooBInAB.html' '//pre' 'pub' + //@ has 'foo/a/b/index.html' '//a[@href="struct.FooBInAB.html"]/..' 'FooBInAB 🔒' + //@ has 'foo/a/b/struct.FooBInAB.html' '//pre' 'struct FooBInAB' + //@ !has 'foo/a/b/struct.FooBInAB.html' '//pre' 'pub' pub(in a::b) struct FooBInAB; - // @has 'foo/a/b/index.html' '//a[@href="struct.FooBPriv.html"]/..' 'FooBPriv 🔒' - // @has 'foo/a/b/struct.FooBPriv.html' '//pre' 'struct FooBPriv' - // @!has 'foo/a/b/struct.FooBPriv.html' '//pre' 'pub' + //@ has 'foo/a/b/index.html' '//a[@href="struct.FooBPriv.html"]/..' 'FooBPriv 🔒' + //@ has 'foo/a/b/struct.FooBPriv.html' '//pre' 'struct FooBPriv' + //@ !has 'foo/a/b/struct.FooBPriv.html' '//pre' 'pub' struct FooBPriv; - // @!has 'foo/a/b/index.html' '//a[@href="struct.FooBPub.html"]/..' 'FooBPub 🔒' - // @has 'foo/a/b/struct.FooBPub.html' '//pre' 'pub struct FooBPub' + //@ !has 'foo/a/b/index.html' '//a[@href="struct.FooBPub.html"]/..' 'FooBPub 🔒' + //@ has 'foo/a/b/struct.FooBPub.html' '//pre' 'pub struct FooBPub' pub struct FooBPub; } } -// @has 'foo/trait.PubTrait.html' '//pre' 'pub trait PubTrait' +//@ has 'foo/trait.PubTrait.html' '//pre' 'pub trait PubTrait' // -// @has 'foo/trait.PubTrait.html' '//pre' 'type Type;' -// @!has 'foo/trait.PubTrait.html' '//pre' 'pub type Type;' +//@ has 'foo/trait.PubTrait.html' '//pre' 'type Type;' +//@ !has 'foo/trait.PubTrait.html' '//pre' 'pub type Type;' // -// @has 'foo/trait.PubTrait.html' '//pre' 'const CONST: usize;' -// @!has 'foo/trait.PubTrait.html' '//pre' 'pub const CONST: usize;' +//@ has 'foo/trait.PubTrait.html' '//pre' 'const CONST: usize;' +//@ !has 'foo/trait.PubTrait.html' '//pre' 'pub const CONST: usize;' // -// @has 'foo/trait.PubTrait.html' '//pre' 'fn function();' -// @!has 'foo/trait.PubTrait.html' '//pre' 'pub fn function();' +//@ has 'foo/trait.PubTrait.html' '//pre' 'fn function();' +//@ !has 'foo/trait.PubTrait.html' '//pre' 'pub fn function();' // -// @!has 'foo/index.html' '//a[@href="trait.PubTrait.html"]/..' 'PubTrait 🔒' +//@ !has 'foo/index.html' '//a[@href="trait.PubTrait.html"]/..' 'PubTrait 🔒' pub trait PubTrait { type Type; @@ -88,17 +88,17 @@ pub trait PubTrait { fn function(); } -// @has 'foo/index.html' '//a[@href="trait.PrivTrait.html"]/..' 'PrivTrait 🔒' +//@ has 'foo/index.html' '//a[@href="trait.PrivTrait.html"]/..' 'PrivTrait 🔒' trait PrivTrait {} -// @has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'type Type' -// @!has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'pub type Type' +//@ has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'type Type' +//@ !has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'pub type Type' // -// @has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'const CONST: usize' -// @!has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'pub const CONST: usize' +//@ has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'const CONST: usize' +//@ !has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'pub const CONST: usize' // -// @has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'fn function()' -// @!has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'pub fn function()' +//@ has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'fn function()' +//@ !has 'foo/struct.FooPublic.html' '//h4[@class="code-header"]' 'pub fn function()' impl PubTrait for FooPublic { type Type = usize; @@ -108,23 +108,23 @@ impl PubTrait for FooPublic { pub struct Assoc; -// @has foo/struct.Assoc.html +//@ has foo/struct.Assoc.html impl Assoc { - // @has - '//*[@id="associatedtype.TypePub"]' 'pub type TypePub' + //@ has - '//*[@id="associatedtype.TypePub"]' 'pub type TypePub' pub type TypePub = usize; - // @has - '//*[@id="associatedtype.TypePriv"]' 'pub(crate) type TypePriv' + //@ has - '//*[@id="associatedtype.TypePriv"]' 'pub(crate) type TypePriv' type TypePriv = usize; - // @has - '//*[@id="associatedconstant.CONST_PUB"]' 'pub const CONST_PUB' + //@ has - '//*[@id="associatedconstant.CONST_PUB"]' 'pub const CONST_PUB' pub const CONST_PUB: usize = 0; - // @has - '//*[@id="associatedconstant.CONST_PRIV"]' 'pub(crate) const CONST_PRIV' + //@ has - '//*[@id="associatedconstant.CONST_PRIV"]' 'pub(crate) const CONST_PRIV' const CONST_PRIV: usize = 0; - // @has - '//*[@id="method.function_pub"]' 'pub fn function_pub()' + //@ has - '//*[@id="method.function_pub"]' 'pub fn function_pub()' pub fn function_pub() {} - // @has - '//*[@id="method.function_priv"]' 'pub(crate) fn function_priv()' + //@ has - '//*[@id="method.function_priv"]' 'pub(crate) fn function_priv()' fn function_priv() {} } diff --git a/tests/rustdoc/where-clause-order.rs b/tests/rustdoc/where-clause-order.rs index e3184b646bf..d765fc10c72 100644 --- a/tests/rustdoc/where-clause-order.rs +++ b/tests/rustdoc/where-clause-order.rs @@ -6,8 +6,8 @@ where { } -// @has 'foo/trait.SomeTrait.html' -// @has - "//*[@id='impl-SomeTrait-for-(A,+B,+C,+D,+E)']/h3" "impl<A, B, C, D, E> SomeTrait for (A, B, C, D, E)where A: PartialOrd<A> + PartialEq<A>, B: PartialOrd<B> + PartialEq<B>, C: PartialOrd<C> + PartialEq<C>, D: PartialOrd<D> + PartialEq<D>, E: PartialOrd<E> + PartialEq<E> + ?Sized, " +//@ has 'foo/trait.SomeTrait.html' +//@ has - "//*[@id='impl-SomeTrait-for-(A,+B,+C,+D,+E)']/h3" "impl<A, B, C, D, E> SomeTrait for (A, B, C, D, E)where A: PartialOrd<A> + PartialEq<A>, B: PartialOrd<B> + PartialEq<B>, C: PartialOrd<C> + PartialEq<C>, D: PartialOrd<D> + PartialEq<D>, E: PartialOrd<E> + PartialEq<E> + ?Sized, " impl<A, B, C, D, E> SomeTrait<(A, B, C, D, E)> for (A, B, C, D, E) where A: PartialOrd<A> + PartialEq<A>, @@ -18,7 +18,7 @@ where { } -// @has - "//*[@id='impl-SomeTrait%3C(A,+B,+C,+D)%3E-for-(A,+B,+C,+D,+E)']/h3" "impl<A, B, C, D, E> SomeTrait<(A, B, C, D)> for (A, B, C, D, E)where A: PartialOrd<A> + PartialEq<A>, B: PartialOrd<B> + PartialEq<B>, C: PartialOrd<C> + PartialEq<C>, D: PartialOrd<D> + PartialEq<D>, E: PartialOrd<E> + PartialEq<E> + ?Sized, " +//@ has - "//*[@id='impl-SomeTrait%3C(A,+B,+C,+D)%3E-for-(A,+B,+C,+D,+E)']/h3" "impl<A, B, C, D, E> SomeTrait<(A, B, C, D)> for (A, B, C, D, E)where A: PartialOrd<A> + PartialEq<A>, B: PartialOrd<B> + PartialEq<B>, C: PartialOrd<C> + PartialEq<C>, D: PartialOrd<D> + PartialEq<D>, E: PartialOrd<E> + PartialEq<E> + ?Sized, " impl<A, B, C, D, E> SomeTrait<(A, B, C, D)> for (A, B, C, D, E) where A: PartialOrd<A> + PartialEq<A>, diff --git a/tests/rustdoc/where-sized.rs b/tests/rustdoc/where-sized.rs index c1ac834b2fc..28907de68d6 100644 --- a/tests/rustdoc/where-sized.rs +++ b/tests/rustdoc/where-sized.rs @@ -1,6 +1,6 @@ #![crate_name = "foo"] -// @has foo/fn.foo.html -// @has - '//pre[@class="rust item-decl"]' 'pub fn foo<X, Y: ?Sized>(_: &X)' -// @has - '//pre[@class="rust item-decl"]' 'where X: ?Sized,' +//@ has foo/fn.foo.html +//@ has - '//pre[@class="rust item-decl"]' 'pub fn foo<X, Y: ?Sized>(_: &X)' +//@ has - '//pre[@class="rust item-decl"]' 'where X: ?Sized,' pub fn foo<X, Y: ?Sized>(_: &X) where X: ?Sized {} diff --git a/tests/rustdoc/where.rs b/tests/rustdoc/where.rs index aea02c14039..aa1d61a0a18 100644 --- a/tests/rustdoc/where.rs +++ b/tests/rustdoc/where.rs @@ -4,35 +4,35 @@ use std::io::Lines; pub trait MyTrait { fn dummy(&self) { } } -// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(/* private fields */) where A: MyTrait" -// @snapshot alpha_trait_decl - '//*[@class="rust item-decl"]/code' +//@ has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(/* private fields */) where A: MyTrait" +//@ snapshot alpha_trait_decl - '//*[@class="rust item-decl"]/code' pub struct Alpha<A>(A) where A: MyTrait; -// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B>where B: MyTrait" -// @snapshot bravo_trait_decl - '//*[@class="rust item-decl"]/code' +//@ has foo/trait.Bravo.html '//pre' "pub trait Bravo<B>where B: MyTrait" +//@ snapshot bravo_trait_decl - '//*[@class="rust item-decl"]/code' pub trait Bravo<B> where B: MyTrait { fn get(&self, B: B); } -// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>()where C: MyTrait" -// @snapshot charlie_fn_decl - '//*[@class="rust item-decl"]/code' +//@ has foo/fn.charlie.html '//pre' "pub fn charlie<C>()where C: MyTrait" +//@ snapshot charlie_fn_decl - '//*[@class="rust item-decl"]/code' pub fn charlie<C>() where C: MyTrait {} pub struct Delta<D>(D); -// @has foo/struct.Delta.html '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has foo/struct.Delta.html '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<D> Delta<D>where D: MyTrait" -// @snapshot SWhere_Echo_impl - '//*[@id="impl-Delta%3CD%3E"]/h3[@class="code-header"]' +//@ snapshot SWhere_Echo_impl - '//*[@id="impl-Delta%3CD%3E"]/h3[@class="code-header"]' impl<D> Delta<D> where D: MyTrait { pub fn delta() {} } pub struct Echo<E>(E); -// @has 'foo/struct.Simd.html' -// @snapshot SWhere_Simd_item-decl - '//pre[@class="rust item-decl"]' +//@ has 'foo/struct.Simd.html' +//@ snapshot SWhere_Simd_item-decl - '//pre[@class="rust item-decl"]' pub struct Simd<T>([T; 1]) where T: MyTrait; -// @has 'foo/trait.TraitWhere.html' -// @snapshot SWhere_TraitWhere_item-decl - '//pre[@class="rust item-decl"]' +//@ has 'foo/trait.TraitWhere.html' +//@ snapshot SWhere_TraitWhere_item-decl - '//pre[@class="rust item-decl"]' pub trait TraitWhere { type Item<'a> where Self: 'a; @@ -53,21 +53,21 @@ pub trait TraitWhere { { todo!() } } -// @has foo/struct.Echo.html '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has foo/struct.Echo.html '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<E> MyTrait for Echo<E>where E: MyTrait" -// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ +//@ has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ // "impl<E> MyTrait for Echo<E>where E: MyTrait" impl<E> MyTrait for Echo<E>where E: MyTrait {} pub enum Foxtrot<F> { Foxtrot1(F) } -// @has foo/enum.Foxtrot.html '//*[@class="impl"]//h3[@class="code-header"]' \ +//@ has foo/enum.Foxtrot.html '//*[@class="impl"]//h3[@class="code-header"]' \ // "impl<F> MyTrait for Foxtrot<F>where F: MyTrait" -// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ +//@ has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \ // "impl<F> MyTrait for Foxtrot<F>where F: MyTrait" impl<F> MyTrait for Foxtrot<F>where F: MyTrait {} -// @has foo/type.Golf.html '//pre[@class="rust item-decl"]' \ +//@ has foo/type.Golf.html '//pre[@class="rust item-decl"]' \ // "type Golf<T>where T: Clone, = (T, T)" -// @snapshot golf_type_alias_decl - '//*[@class="rust item-decl"]/code' +//@ snapshot golf_type_alias_decl - '//*[@class="rust item-decl"]/code' pub type Golf<T> where T: Clone = (T, T); diff --git a/tests/rustdoc/whitespace-after-where-clause.rs b/tests/rustdoc/whitespace-after-where-clause.rs index 832d3728e75..d1a45c7a768 100644 --- a/tests/rustdoc/whitespace-after-where-clause.rs +++ b/tests/rustdoc/whitespace-after-where-clause.rs @@ -3,8 +3,8 @@ #![crate_name = "foo"] -// @has 'foo/trait.ToOwned.html' -// @snapshot trait - '//*[@class="rust item-decl"]' +//@ has 'foo/trait.ToOwned.html' +//@ snapshot trait - '//*[@class="rust item-decl"]' pub trait ToOwned<T> where T: Clone, @@ -14,8 +14,8 @@ where fn whatever(&self) -> T; } -// @has 'foo/trait.ToOwned2.html' -// @snapshot trait2 - '//*[@class="rust item-decl"]' +//@ has 'foo/trait.ToOwned2.html' +//@ snapshot trait2 - '//*[@class="rust item-decl"]' // There should be a whitespace before `{` in this case! pub trait ToOwned2<T: Clone> { type Owned; @@ -23,8 +23,8 @@ pub trait ToOwned2<T: Clone> { fn whatever(&self) -> T; } -// @has 'foo/enum.Cow.html' -// @snapshot enum - '//*[@class="rust item-decl"]' +//@ has 'foo/enum.Cow.html' +//@ snapshot enum - '//*[@class="rust item-decl"]' pub enum Cow<'a, B: ?Sized + 'a> where B: ToOwned<()>, @@ -33,16 +33,16 @@ where Whatever(u32), } -// @has 'foo/enum.Cow2.html' -// @snapshot enum2 - '//*[@class="rust item-decl"]' +//@ has 'foo/enum.Cow2.html' +//@ snapshot enum2 - '//*[@class="rust item-decl"]' // There should be a whitespace before `{` in this case! pub enum Cow2<'a, B: ?Sized + ToOwned<()> + 'a> { Borrowed(&'a B), Whatever(u32), } -// @has 'foo/struct.Struct.html' -// @snapshot struct - '//*[@class="rust item-decl"]' +//@ has 'foo/struct.Struct.html' +//@ snapshot struct - '//*[@class="rust item-decl"]' pub struct Struct<'a, B: ?Sized + 'a> where B: ToOwned<()>, @@ -51,16 +51,16 @@ where pub b: u32, } -// @has 'foo/struct.Struct2.html' -// @snapshot struct2 - '//*[@class="rust item-decl"]' +//@ has 'foo/struct.Struct2.html' +//@ snapshot struct2 - '//*[@class="rust item-decl"]' // There should be a whitespace before `{` in this case! pub struct Struct2<'a, B: ?Sized + ToOwned<()> + 'a> { pub a: &'a B, pub b: u32, } -// @has 'foo/union.Union.html' -// @snapshot union - '//*[@class="rust item-decl"]' +//@ has 'foo/union.Union.html' +//@ snapshot union - '//*[@class="rust item-decl"]' pub union Union<'a, B: ?Sized + 'a> where B: ToOwned<()>, @@ -69,8 +69,8 @@ where b: u32, } -// @has 'foo/union.Union2.html' -// @snapshot union2 - '//*[@class="rust item-decl"]' +//@ has 'foo/union.Union2.html' +//@ snapshot union2 - '//*[@class="rust item-decl"]' // There should be a whitespace before `{` in this case! pub union Union2<'a, B: ?Sized + ToOwned<()> + 'a> { a: &'a B, diff --git a/tests/rustdoc/without-redirect.rs b/tests/rustdoc/without-redirect.rs index a076f8a3c5e..f8a332a5dd7 100644 --- a/tests/rustdoc/without-redirect.rs +++ b/tests/rustdoc/without-redirect.rs @@ -1,13 +1,13 @@ #![crate_name = "foo"] -// @has foo/macro.bar.html -// @has foo/macro.bar!.html -// @!has foo/bar.m.html +//@ has foo/macro.bar.html +//@ has foo/macro.bar!.html +//@ !has foo/bar.m.html #[macro_export] macro_rules! bar { () => {} } -// @has foo/struct.Bar.html -// @!has foo/Bar.t.html +//@ has foo/struct.Bar.html +//@ !has foo/Bar.t.html pub struct Bar; diff --git a/tests/rustdoc/wrapping.rs b/tests/rustdoc/wrapping.rs index dd5c700329f..43146c73dd0 100644 --- a/tests/rustdoc/wrapping.rs +++ b/tests/rustdoc/wrapping.rs @@ -1,5 +1,5 @@ use std::fmt::Debug; -// @has 'wrapping/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo() -> impl Debug' -// @count - '//pre[@class="rust item-decl"]/br' 0 +//@ has 'wrapping/fn.foo.html' '//pre[@class="rust item-decl"]' 'pub fn foo() -> impl Debug' +//@ count - '//pre[@class="rust item-decl"]/br' 0 pub fn foo() -> impl Debug {}