Skip to content

Commit 7a8257d

Browse files
committedNov 13, 2024
Add regression test for #131901
1 parent d9aac8c commit 7a8257d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
 

‎tests/rustdoc/footnote-ids.rs

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// This test ensures that footnotes ID are not duplicated across an item page.
2+
// This is a regression test for <https://github.com/rust-lang/rust/issues/131901>.
3+
4+
#![crate_name = "foo"]
5+
6+
//@ has 'foo/struct.Foo.html'
7+
8+
pub struct Foo;
9+
10+
impl Foo {
11+
//@ has - '//a[@href="#fn1"]' '1'
12+
//@ has - '//li[@id="fn1"]' 'Hiya'
13+
//@ has - '//a[@href="#fn2"]' '2'
14+
//@ has - '//li[@id="fn2"]' 'Tiya'
15+
/// Link 1 [^1]
16+
/// Link 1.1 [^2]
17+
///
18+
/// [^1]: Hiya
19+
/// [^2]: Tiya
20+
pub fn l1(){}
21+
22+
//@ has - '//a[@href="#fn3"]' '1'
23+
//@ has - '//li[@id="fn3"]' 'Yiya'
24+
//@ has - '//a[@href="#fn4"]' '2'
25+
//@ has - '//li[@id="fn4"]' 'Biya'
26+
/// Link 2 [^1]
27+
/// Link 3 [^2]
28+
///
29+
/// [^1]: Yiya
30+
/// [^2]: Biya
31+
pub fn l2() {}
32+
}
33+
34+
impl Foo {
35+
//@ has - '//a[@href="#fn5"]' '1'
36+
//@ has - '//li[@id="fn5"]' 'Ciya'
37+
/// Link 3 [^1]
38+
///
39+
/// [^1]: Ciya
40+
pub fn l3(){}
41+
}

0 commit comments

Comments
 (0)