Skip to content

Commit 38b51f8

Browse files
Add regression test for doc alias matching vs equivalently matched items
1 parent c603117 commit 38b51f8

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// exact-check
2+
3+
// Checking that doc aliases are always listed after items with equivalent matching.
4+
5+
const EXPECTED = [
6+
{
7+
'query': 'coo',
8+
'others': [
9+
{
10+
'path': 'doc_alias_after_other_items',
11+
'name': 'Foo',
12+
'href': '../doc_alias_after_other_items/struct.Foo.html',
13+
},
14+
{
15+
'path': 'doc_alias_after_other_items',
16+
'name': 'bar',
17+
'alias': 'Boo',
18+
'is_alias': true
19+
},
20+
],
21+
},
22+
{
23+
'query': '"confiture"',
24+
'others': [
25+
{
26+
'path': 'doc_alias_after_other_items',
27+
'name': 'Confiture',
28+
'href': '../doc_alias_after_other_items/struct.Confiture.html',
29+
},
30+
{
31+
'path': 'doc_alias_after_other_items',
32+
'name': 'this_is_a_long_name',
33+
'alias': 'Confiture',
34+
'is_alias': true
35+
},
36+
],
37+
},
38+
];
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pub struct Foo;
2+
3+
#[doc(alias = "Boo")]
4+
pub fn bar() {}
5+
6+
pub struct Confiture;
7+
8+
#[doc(alias = "Confiture")]
9+
pub fn this_is_a_long_name() {}

0 commit comments

Comments
 (0)