Skip to content

Commit 7c21fbf

Browse files
Add test for aliases partial match
1 parent 9c72be3 commit 7c21fbf

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

tests/rustdoc-js-std/alias-lev.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// This test ensures that aliases are also allowed to be partially matched.
2+
3+
// ignore-order
4+
5+
const EXPECTED = {
6+
// The full alias name is `getcwd`.
7+
'query': 'getcw',
8+
'others': [
9+
{ 'path': 'std::env', 'name': 'current_dir', 'alias': 'getcwd' },
10+
],
11+
};

tests/rustdoc-js/non-english-identifier.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,10 @@ const EXPECTED = [
115115
query: '加法',
116116
others: [
117117
{
118-
name: "add",
118+
name: "加法",
119119
path: "non_english_identifier",
120-
is_alias: true,
121-
alias: "加法",
122-
href: "../non_english_identifier/macro.add.html"
120+
href: "../non_english_identifier/trait.加法.html",
121+
desc: "Add"
123122
},
124123
{
125124
name: "add",
@@ -129,11 +128,13 @@ const EXPECTED = [
129128
href: "../non_english_identifier/fn.add.html"
130129
},
131130
{
132-
name: "加法",
131+
name: "add",
133132
path: "non_english_identifier",
134-
href: "../non_english_identifier/trait.加法.html",
135-
desc: "Add"
136-
}],
133+
is_alias: true,
134+
alias: "加法",
135+
href: "../non_english_identifier/macro.add.html"
136+
},
137+
],
137138
in_args: [{
138139
name: "加上",
139140
path: "non_english_identifier::加法",

0 commit comments

Comments
 (0)