Skip to content

Commit bd704ba

Browse files
Update tests accordingly
1 parent d06f72d commit bd704ba

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

src/test/rustdoc/assoc-consts.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
pub trait Foo {
1414
// @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \
1515
// 'const FOO: usize;'
16-
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO'
17-
const FOO: usize;
16+
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
17+
// @has - '//*[@class="docblock"]' 'FOO: usize = 12'
18+
const FOO: usize = 12;
1819
}
1920

2021
pub struct Bar;
2122

2223
impl Bar {
2324
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \
24-
// 'const BAR: usize = 3'
25+
// 'const BAR: usize'
26+
// @has - '//*[@class="docblock"]' 'BAR: usize = 3'
2527
pub const BAR: usize = 3;
2628
}

src/test/rustdoc/issue-28478.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ pub trait Bar {
1616
// @has - '//*[@id="associatedtype.Bar"]' 'type Bar = ()'
1717
// @has - '//*[@href="#associatedtype.Bar"]' 'Bar'
1818
type Bar = ();
19-
// @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize = 7'
19+
// @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize'
20+
// @has - '//*[@class="docblock"]' 'Baz: usize = 7'
2021
// @has - '//*[@href="#associatedconstant.Baz"]' 'Baz'
2122
const Baz: usize = 7;
2223
// @has - '//*[@id="tymethod.bar"]' 'fn bar'

src/test/rustdoc/issue-33302.rs

+26-4
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,40 @@ macro_rules! make {
2828
fn ignore(_: &X) {}
2929
const C: X;
3030
// @has issue_33302/trait.T.html \
31-
// '//*[@class="rust trait"]' 'const D: i32 = 4 * 4;'
32-
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32 = 4 * 4'
31+
// '//*[@class="rust trait"]' 'const D: i32'
32+
// @has - '//*[@class="docblock"]' 'D: i32 = 4 * 4'
33+
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32'
3334
const D: i32 = ($n * $n);
3435
}
3536

3637
// @has issue_33302/struct.S.html \
3738
// '//h3[@class="impl"]' 'impl T<[i32; 16]> for S'
38-
// @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16] = [0; 4 * 4]'
39-
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32 = 4 * 4'
39+
// @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]'
40+
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32'
41+
// @has - '//*[@class="docblock"]' 'C: [i32; 16] = [0; 4 * 4]'
4042
impl T<[i32; ($n * $n)]> for S {
4143
const C: [i32; ($n * $n)] = [0; ($n * $n)];
4244
}
45+
46+
// @has issue_33302/struct.S.html \
47+
// '//h3[@class="impl"]' 'impl T<[i32; 16]> for S'
48+
// @has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)'
49+
// @has - '//*[@id="associatedconstant.D-1"]' 'const D: i32'
50+
// @has - '//*[@class="docblock"]' 'C: (i32,) = (4,)'
51+
impl T<(i32,)> for S {
52+
const C: (i32,) = ($n,);
53+
}
54+
55+
// @has issue_33302/struct.S.html \
56+
// '//h3[@class="impl"]' 'impl T<(i32, i32)> for S'
57+
// @has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)'
58+
// @has - '//*[@id="associatedconstant.D-2"]' 'const D: i32'
59+
// @has - '//*[@class="docblock"]' 'C: (i32, i32) = (4, 4)'
60+
// @has - '//*[@class="docblock"]' 'D: i32 = 4 / 4'
61+
impl T<(i32, i32)> for S {
62+
const C: (i32, i32) = ($n, $n);
63+
const D: i32 = ($n / $n);
64+
}
4365
}
4466
}
4567

0 commit comments

Comments
 (0)