提交 b0ee5ded 编写于 作者: G Guillaume Gomez

Update tests

上级 a5459443
...@@ -13,7 +13,6 @@ pub trait Foo { ...@@ -13,7 +13,6 @@ pub trait Foo {
// @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \ // @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \
// 'const FOO: usize;' // 'const FOO: usize;'
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize' // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
// @has - '//*[@class="docblock"]' 'FOO: usize = 12'
const FOO: usize = 12; 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; const FOO_NO_DEFAULT: bool;
...@@ -27,10 +26,8 @@ pub trait Foo { ...@@ -27,10 +26,8 @@ pub trait Foo {
impl Foo for Bar { impl Foo for Bar {
// @has assoc_consts/struct.Bar.html '//code' 'impl Foo for Bar' // @has assoc_consts/struct.Bar.html '//code' 'impl Foo for Bar'
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize' // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
// @has - '//*[@class="docblock"]' 'FOO: usize = 12'
const FOO: usize = 12; 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'
// @has - '//*[@class="docblock"]' 'FOO_NO_DEFAULT: bool = false'
const FOO_NO_DEFAULT: bool = false; const FOO_NO_DEFAULT: bool = false;
// @!has - FOO_HIDDEN // @!has - FOO_HIDDEN
#[doc(hidden)] #[doc(hidden)]
...@@ -40,7 +37,6 @@ impl Foo for Bar { ...@@ -40,7 +37,6 @@ impl Foo for Bar {
impl Bar { impl Bar {
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \ // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \
// 'const BAR: usize' // 'const BAR: usize'
// @has - '//*[@class="docblock"]' 'BAR: usize = 3'
pub const BAR: usize = 3; pub const BAR: usize = 3;
} }
...@@ -49,7 +45,6 @@ impl Bar { ...@@ -49,7 +45,6 @@ impl Bar {
impl Bar { 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>" // "const BAZ: Baz<'static, u8, u32>"
// @has - '//*[@class="docblock"]' "BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3])"
pub const BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3]); pub const BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3]);
} }
...@@ -58,7 +53,6 @@ pub fn f(_: &(ToString + 'static)) {} ...@@ -58,7 +53,6 @@ pub fn f(_: &(ToString + 'static)) {}
impl Bar { impl Bar {
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \ // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \
// "const F: fn(_: &(ToString + 'static))" // "const F: fn(_: &(ToString + 'static))"
// @has - '//*[@class="docblock"]' "F: fn(_: &(ToString + 'static)) = f"
pub const F: fn(_: &(ToString + 'static)) = f; pub const F: fn(_: &(ToString + 'static)) = f;
} }
...@@ -81,17 +75,14 @@ pub trait Qux { ...@@ -81,17 +75,14 @@ pub trait Qux {
/// Docs for QUX1 in trait. /// Docs for QUX1 in trait.
const QUX1: i8; const QUX1: i8;
// @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16' // @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
// @has - '//*[@class="docblock"]' "QUX_DEFAULT0: u16 = 1"
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT0 in trait." // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT0 in trait."
/// Docs for QUX_DEFAULT0 in trait. /// Docs for QUX_DEFAULT0 in trait.
const QUX_DEFAULT0: u16 = 1; const QUX_DEFAULT0: u16 = 1;
// @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16' // @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
// @has - '//*[@class="docblock"]' "QUX_DEFAULT1: i16 = 2"
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in trait." // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in trait."
/// Docs for QUX_DEFAULT1 in trait. /// Docs for QUX_DEFAULT1 in trait.
const QUX_DEFAULT1: i16 = 2; const QUX_DEFAULT1: i16 = 2;
// @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32' // @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32'
// @has - '//*[@class="docblock"]' "QUX_DEFAULT2: u32 = 3"
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait." // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
/// Docs for QUX_DEFAULT2 in trait. /// Docs for QUX_DEFAULT2 in trait.
const QUX_DEFAULT2: u32 = 3; const QUX_DEFAULT2: u32 = 3;
...@@ -100,25 +91,20 @@ pub trait Qux { ...@@ -100,25 +91,20 @@ pub trait Qux {
// @has assoc_consts/struct.Bar.html '//code' 'impl Qux for Bar' // @has assoc_consts/struct.Bar.html '//code' 'impl Qux for Bar'
impl Qux for Bar { impl Qux for Bar {
// @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8' // @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
// @has - '//*[@class="docblock"]' "QUX0: u8 = 4"
// @has - '//*[@class="docblock"]' "Docs for QUX0 in trait." // @has - '//*[@class="docblock"]' "Docs for QUX0 in trait."
/// Docs for QUX0 in trait. /// Docs for QUX0 in trait.
const QUX0: u8 = 4; const QUX0: u8 = 4;
// @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8' // @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8'
// @has - '//*[@class="docblock"]' "QUX1: i8 = 5"
// @has - '//*[@class="docblock"]' "Docs for QUX1 in impl." // @has - '//*[@class="docblock"]' "Docs for QUX1 in impl."
/// Docs for QUX1 in impl. /// Docs for QUX1 in impl.
const QUX1: i8 = 5; const QUX1: i8 = 5;
// @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16' // @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
// @has - '//*[@class="docblock"]' "QUX_DEFAULT0: u16 = 6"
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT0 in trait." // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT0 in trait."
const QUX_DEFAULT0: u16 = 6; const QUX_DEFAULT0: u16 = 6;
// @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16' // @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
// @has - '//*[@class="docblock"]' "QUX_DEFAULT1: i16 = 7"
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in impl." // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in impl."
/// Docs for QUX_DEFAULT1 in impl. /// Docs for QUX_DEFAULT1 in impl.
const QUX_DEFAULT1: i16 = 7; const QUX_DEFAULT1: i16 = 7;
// @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32' // @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32'
// @has - '//*[@class="docblock"]' "QUX_DEFAULT2: u32 = 3"
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait." // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
} }
...@@ -23,7 +23,7 @@ pub struct ContentType { ...@@ -23,7 +23,7 @@ pub struct ContentType {
impl ContentType { impl ContentType {
// @has const_doc/struct.ContentType.html // @has const_doc/struct.ContentType.html
// @has - '//*[@class="docblock"]' 'Any: ContentType = ContentType{ttype: Foo{f: ' // @has - '//*[@id="associatedconstant.Any"]' 'const Any: ContentType'
pub const Any: ContentType = ContentType { ttype: Foo { f: PhantomData, }, pub const Any: ContentType = ContentType { ttype: Foo { f: PhantomData, },
subtype: Foo { f: PhantomData, }, subtype: Foo { f: PhantomData, },
params: None, }; params: None, };
......
...@@ -19,16 +19,13 @@ ...@@ -19,16 +19,13 @@
// @has foo/struct.MyStruct.html // @has foo/struct.MyStruct.html
// @!has - 'PrivateConst' // @!has - 'PrivateConst'
// @has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8' // @has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8'
// @has - '//*[@class="docblock"]' 'PublicConst: u8 = 123'
// @has - '//*[@class="docblock"]' 'docs for PublicConst' // @has - '//*[@class="docblock"]' 'docs for PublicConst'
// @!has - 'private_method' // @!has - 'private_method'
// @has - '//*[@id="method.public_method"]' 'pub fn public_method()' // @has - '//*[@id="method.public_method"]' 'pub fn public_method()'
// @has - '//*[@class="docblock"]' 'docs for public_method' // @has - '//*[@class="docblock"]' 'docs for public_method'
// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16' // @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
// @has - '//*[@class="docblock"]' 'ConstNoDefault: i16 = -123'
// @has - '//*[@class="docblock"]' 'dox for ConstNoDefault' // @has - '//*[@class="docblock"]' 'dox for ConstNoDefault'
// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16' // @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16'
// @has - '//*[@class="docblock"]' 'ConstWithDefault: u16 = 12345'
// @has - '//*[@class="docblock"]' 'docs for ConstWithDefault' // @has - '//*[@class="docblock"]' 'docs for ConstWithDefault'
// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault = i32' // @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault = i32'
// @has - '//*[@class="docblock"]' 'dox for TypeNoDefault' // @has - '//*[@class="docblock"]' 'dox for TypeNoDefault'
...@@ -44,11 +41,9 @@ ...@@ -44,11 +41,9 @@
// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16' // @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
// @has - '//*[@class="docblock"]' 'docs for ConstNoDefault' // @has - '//*[@class="docblock"]' 'docs for ConstNoDefault'
// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16' // @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16'
// @has - '//*[@class="docblock"]' 'ConstWithDefault: u16 = 12345'
// @has - '//*[@class="docblock"]' 'docs for ConstWithDefault' // @has - '//*[@class="docblock"]' 'docs for ConstWithDefault'
// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault' // @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault'
// @has - '//*[@class="docblock"]' 'docs for TypeNoDefault' // @has - '//*[@class="docblock"]' 'docs for TypeNoDefault'
// @has - '//*[@id="associatedtype.TypeWithDefault"]' 'type TypeWithDefault = u32'
// @has - '//*[@class="docblock"]' 'docs for TypeWithDefault' // @has - '//*[@class="docblock"]' 'docs for TypeWithDefault'
// @has - '//*[@id="tymethod.method_no_default"]' 'fn method_no_default()' // @has - '//*[@id="tymethod.method_no_default"]' 'fn method_no_default()'
// @has - '//*[@class="docblock"]' 'docs for method_no_default' // @has - '//*[@class="docblock"]' 'docs for method_no_default'
......
...@@ -16,7 +16,6 @@ pub trait Bar { ...@@ -16,7 +16,6 @@ pub trait Bar {
// @has - '//*[@href="#associatedtype.Bar"]' 'Bar' // @has - '//*[@href="#associatedtype.Bar"]' 'Bar'
type Bar = (); type Bar = ();
// @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize' // @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize'
// @has - '//*[@class="docblock"]' 'Baz: usize = 7'
// @has - '//*[@href="#associatedconstant.Baz"]' 'Baz' // @has - '//*[@href="#associatedconstant.Baz"]' 'Baz'
const Baz: usize = 7; const Baz: usize = 7;
// @has - '//*[@id="tymethod.bar"]' 'fn bar' // @has - '//*[@id="tymethod.bar"]' 'fn bar'
......
...@@ -28,7 +28,6 @@ fn ignore(_: &X) {} ...@@ -28,7 +28,6 @@ fn ignore(_: &X) {}
const C: X; const C: X;
// @has issue_33302/trait.T.html \ // @has issue_33302/trait.T.html \
// '//*[@class="rust trait"]' 'const D: i32' // '//*[@class="rust trait"]' 'const D: i32'
// @has - '//*[@class="docblock"]' 'D: i32 = 4 * 4'
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32' // @has - '//*[@id="associatedconstant.D"]' 'const D: i32'
const D: i32 = ($n * $n); const D: i32 = ($n * $n);
} }
...@@ -37,7 +36,6 @@ fn ignore(_: &X) {} ...@@ -37,7 +36,6 @@ fn ignore(_: &X) {}
// '//h3[@class="impl"]' 'impl T<[i32; 16]> for S' // '//h3[@class="impl"]' 'impl T<[i32; 16]> for S'
// @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]' // @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]'
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32' // @has - '//*[@id="associatedconstant.D"]' 'const D: i32'
// @has - '//*[@class="docblock"]' 'C: [i32; 16] = [0; 4 * 4]'
impl T<[i32; ($n * $n)]> for S { impl T<[i32; ($n * $n)]> for S {
const C: [i32; ($n * $n)] = [0; ($n * $n)]; const C: [i32; ($n * $n)] = [0; ($n * $n)];
} }
...@@ -46,7 +44,6 @@ fn ignore(_: &X) {} ...@@ -46,7 +44,6 @@ fn ignore(_: &X) {}
// '//h3[@class="impl"]' 'impl T<[i32; 16]> for S' // '//h3[@class="impl"]' 'impl T<[i32; 16]> for S'
// @has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)' // @has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)'
// @has - '//*[@id="associatedconstant.D-1"]' 'const D: i32' // @has - '//*[@id="associatedconstant.D-1"]' 'const D: i32'
// @has - '//*[@class="docblock"]' 'C: (i32,) = (4,)'
impl T<(i32,)> for S { impl T<(i32,)> for S {
const C: (i32,) = ($n,); const C: (i32,) = ($n,);
} }
...@@ -55,8 +52,6 @@ impl T<(i32,)> for S { ...@@ -55,8 +52,6 @@ impl T<(i32,)> for S {
// '//h3[@class="impl"]' 'impl T<(i32, i32)> for S' // '//h3[@class="impl"]' 'impl T<(i32, i32)> for S'
// @has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)' // @has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)'
// @has - '//*[@id="associatedconstant.D-2"]' 'const D: i32' // @has - '//*[@id="associatedconstant.D-2"]' 'const D: i32'
// @has - '//*[@class="docblock"]' 'C: (i32, i32) = (4, 4)'
// @has - '//*[@class="docblock"]' 'D: i32 = 4 / 4'
impl T<(i32, i32)> for S { impl T<(i32, i32)> for S {
const C: (i32, i32) = ($n, $n); const C: (i32, i32) = ($n, $n);
const D: i32 = ($n / $n); const D: i32 = ($n / $n);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册