diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-15 21:08:18 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-16 14:27:22 +0200 |
| commit | c079c96877fdd3977c8d5be830931ecb4f79018d (patch) | |
| tree | 8ebd3410dd0556b32f8811e020efb6b2313066e9 | |
| parent | b0bf51f9a9323ca5abf595c6d0653d60fe68ee24 (diff) | |
| download | rust-c079c96877fdd3977c8d5be830931ecb4f79018d.tar.gz rust-c079c96877fdd3977c8d5be830931ecb4f79018d.zip | |
Add test for aliases partial match
| -rw-r--r-- | tests/rustdoc-js-std/alias-lev.js | 11 | ||||
| -rw-r--r-- | tests/rustdoc-js/non-english-identifier.js | 17 |
2 files changed, 20 insertions, 8 deletions
diff --git a/tests/rustdoc-js-std/alias-lev.js b/tests/rustdoc-js-std/alias-lev.js new file mode 100644 index 00000000000..17f3dc25d76 --- /dev/null +++ b/tests/rustdoc-js-std/alias-lev.js @@ -0,0 +1,11 @@ +// This test ensures that aliases are also allowed to be partially matched. + +// ignore-order + +const EXPECTED = { + // The full alias name is `getcwd`. + 'query': 'getcw', + 'others': [ + { 'path': 'std::env', 'name': 'current_dir', 'alias': 'getcwd' }, + ], +}; diff --git a/tests/rustdoc-js/non-english-identifier.js b/tests/rustdoc-js/non-english-identifier.js index f2180b4c755..3d50bd3ee90 100644 --- a/tests/rustdoc-js/non-english-identifier.js +++ b/tests/rustdoc-js/non-english-identifier.js @@ -115,11 +115,10 @@ const EXPECTED = [ query: '加法', others: [ { - name: "add", + name: "加法", path: "non_english_identifier", - is_alias: true, - alias: "加法", - href: "../non_english_identifier/macro.add.html" + href: "../non_english_identifier/trait.加法.html", + desc: "Add" }, { name: "add", @@ -129,11 +128,13 @@ const EXPECTED = [ href: "../non_english_identifier/fn.add.html" }, { - name: "加法", + name: "add", path: "non_english_identifier", - href: "../non_english_identifier/trait.加法.html", - desc: "Add" - }], + is_alias: true, + alias: "加法", + href: "../non_english_identifier/macro.add.html" + }, + ], in_args: [{ name: "加上", path: "non_english_identifier::加法", |
