Skip to content

Commit 1210aac

Browse files
Add more complex test cases for enum discriminant display
1 parent 4b6fc8b commit 1210aac

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: tests/rustdoc/enum-variant-value.rs

+19
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,22 @@ pub use bar::G;
9696
// @matches - '//*[@id="variant.A"]/h3' '^A$'
9797
// @has - '//*[@id="variant.C"]/h3' 'C(u32)'
9898
pub use bar::H;
99+
100+
// Testing more complex cases.
101+
pub const X: isize = 2;
102+
// @has 'foo/enum.I.html'
103+
// @has - '//*[@class="rust item-decl"]/code' 'A = 2,'
104+
// @has - '//*[@class="rust item-decl"]/code' 'B = 4,'
105+
// @has - '//*[@class="rust item-decl"]/code' 'C = 9,'
106+
// @has - '//*[@class="rust item-decl"]/code' 'D = -1,'
107+
// @matches - '//*[@id="variant.A"]/h3' '^A = 2$'
108+
// @matches - '//*[@id="variant.B"]/h3' '^B = 4$'
109+
// @matches - '//*[@id="variant.C"]/h3' '^C = 9$'
110+
// @matches - '//*[@id="variant.D"]/h3' '^D = -1$'
111+
#[repr(isize)]
112+
pub enum I {
113+
A = X,
114+
B = X * 2,
115+
C = Self::B as isize + X + 3,
116+
D = -1,
117+
}

0 commit comments

Comments
 (0)