Skip to content

Commit 95cb0e5

Browse files
Add regression test for doc alias matching vs equivalently matched items
1 parent 9d84c1f commit 95cb0e5

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// exact-check
2+
3+
// Checking that doc aliases are always listed after items with equivalent matching.
4+
5+
const EXPECTED = [
6+
{
7+
'query': 'bar',
8+
'others': [
9+
{
10+
'path': 'doc_alias_after_other_items',
11+
'name': 'Bar',
12+
'href': '../doc_alias_after_other_items/struct.Bar.html',
13+
},
14+
{
15+
'path': 'doc_alias_after_other_items',
16+
'name': 'foo',
17+
'alias': 'Bar',
18+
'is_alias': true
19+
},
20+
],
21+
},
22+
{
23+
'query': 'ba',
24+
'others': [
25+
{
26+
'path': 'doc_alias_after_other_items',
27+
'name': 'Bar',
28+
'href': '../doc_alias_after_other_items/struct.Bar.html',
29+
},
30+
{
31+
'path': 'doc_alias_after_other_items',
32+
'name': 'foo',
33+
'alias': 'Bar',
34+
'is_alias': true
35+
},
36+
],
37+
},
38+
{
39+
'query': '"bar"',
40+
'others': [
41+
{
42+
'path': 'doc_alias_after_other_items',
43+
'name': 'Bar',
44+
'href': '../doc_alias_after_other_items/struct.Bar.html',
45+
},
46+
{
47+
'path': 'doc_alias_after_other_items',
48+
'name': 'foo',
49+
'alias': 'Bar',
50+
'is_alias': true
51+
},
52+
],
53+
},
54+
];
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pub struct Bar;
2+
3+
#[doc(alias = "Bar")]
4+
pub fn foo() {}

0 commit comments

Comments
 (0)