Add regression test for doc alias matching vs equivalently matched items

This commit is contained in:
Guillaume Gomez 2025-08-08 14:05:19 +02:00
parent b39357bbf3
commit a34bd2baf5
2 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,38 @@
// exact-check
// Checking that doc aliases are always listed after items with equivalent matching.
const EXPECTED = [
{
'query': 'coo',
'others': [
{
'path': 'doc_alias_after_other_items',
'name': 'Foo',
'href': '../doc_alias_after_other_items/struct.Foo.html',
},
{
'path': 'doc_alias_after_other_items',
'name': 'bar',
'alias': 'Boo',
'is_alias': true
},
],
},
{
'query': '"confiture"',
'others': [
{
'path': 'doc_alias_after_other_items',
'name': 'Confiture',
'href': '../doc_alias_after_other_items/struct.Confiture.html',
},
{
'path': 'doc_alias_after_other_items',
'name': 'this_is_a_long_name',
'alias': 'Confiture',
'is_alias': true
},
],
},
];

View file

@ -0,0 +1,9 @@
pub struct Foo;
#[doc(alias = "Boo")]
pub fn bar() {}
pub struct Confiture;
#[doc(alias = "Confiture")]
pub fn this_is_a_long_name() {}