Add regression test for doc alias matching vs equivalently matched items
This commit is contained in:
parent
b39357bbf3
commit
a34bd2baf5
2 changed files with 47 additions and 0 deletions
38
tests/rustdoc-js/doc-alias-after-other-items.js
Normal file
38
tests/rustdoc-js/doc-alias-after-other-items.js
Normal 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
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
9
tests/rustdoc-js/doc-alias-after-other-items.rs
Normal file
9
tests/rustdoc-js/doc-alias-after-other-items.rs
Normal 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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue