diff --git a/tests/rustdoc-js-std/alias-1.js b/tests/rustdoc-js-std/alias-1.js index 7c6327fcdd7..b27b3da2179 100644 --- a/tests/rustdoc-js-std/alias-1.js +++ b/tests/rustdoc-js-std/alias-1.js @@ -1,6 +1,5 @@ -const QUERY = '&'; - const EXPECTED = { + 'query': '&', 'others': [ { 'path': 'std', 'name': 'reference' }, ], diff --git a/tests/rustdoc-js-std/alias-2.js b/tests/rustdoc-js-std/alias-2.js index 798fa29efbd..5735b573bcb 100644 --- a/tests/rustdoc-js-std/alias-2.js +++ b/tests/rustdoc-js-std/alias-2.js @@ -1,6 +1,5 @@ -const QUERY = '+'; - const EXPECTED = { + 'query': '+', 'others': [ { 'path': 'std::ops', 'name': 'AddAssign' }, { 'path': 'std::ops', 'name': 'Add' }, diff --git a/tests/rustdoc-js-std/alias-3.js b/tests/rustdoc-js-std/alias-3.js index 392b1e81837..ed3776b3c2a 100644 --- a/tests/rustdoc-js-std/alias-3.js +++ b/tests/rustdoc-js-std/alias-3.js @@ -1,6 +1,5 @@ -const QUERY = '!'; - const EXPECTED = { + 'query': '!', 'others': [ { 'path': 'std', 'name': 'never' }, ], diff --git a/tests/rustdoc-js-std/alias-4.js b/tests/rustdoc-js-std/alias-4.js index bf2bb4d2981..35840a472c1 100644 --- a/tests/rustdoc-js-std/alias-4.js +++ b/tests/rustdoc-js-std/alias-4.js @@ -1,6 +1,5 @@ -const QUERY = '<'; - const EXPECTED = { + 'query': '<', 'others': [ { 'name': 'Ord' }, ], diff --git a/tests/rustdoc-js-std/alias.js b/tests/rustdoc-js-std/alias.js index 2b709c99119..bf707fa03dc 100644 --- a/tests/rustdoc-js-std/alias.js +++ b/tests/rustdoc-js-std/alias.js @@ -1,8 +1,7 @@ // ignore-order -const QUERY = '['; - const EXPECTED = { + 'query': '[', 'others': [ { 'path': 'std', 'name': 'slice' }, { 'path': 'std::ops', 'name': 'IndexMut' }, diff --git a/tests/rustdoc-js-std/asrawfd.js b/tests/rustdoc-js-std/asrawfd.js index 369a34f9c6e..5b3cfeabbcd 100644 --- a/tests/rustdoc-js-std/asrawfd.js +++ b/tests/rustdoc-js-std/asrawfd.js @@ -1,8 +1,7 @@ // ignore-order -const QUERY = 'RawFd::as_raw_fd'; - const EXPECTED = { + 'query': 'RawFd::as_raw_fd', 'others': [ // Reproduction test for https://github.com/rust-lang/rust/issues/78724 // Validate that type alias methods get the correct path. diff --git a/tests/rustdoc-js-std/basic.js b/tests/rustdoc-js-std/basic.js index 824cac71083..baff24b0af6 100644 --- a/tests/rustdoc-js-std/basic.js +++ b/tests/rustdoc-js-std/basic.js @@ -1,6 +1,5 @@ -const QUERY = 'String'; - const EXPECTED = { + 'query': 'String', 'others': [ { 'path': 'std::string', 'name': 'String' }, { 'path': 'std::ffi', 'name': 'CString' }, diff --git a/tests/rustdoc-js-std/deduplication.js b/tests/rustdoc-js-std/deduplication.js index f02f6cf55ed..51279dd5ed4 100644 --- a/tests/rustdoc-js-std/deduplication.js +++ b/tests/rustdoc-js-std/deduplication.js @@ -1,8 +1,7 @@ // ignore-order -const QUERY = 'is_nan'; - const EXPECTED = { + 'query': 'is_nan', 'others': [ { 'path': 'std::f32', 'name': 'is_nan' }, { 'path': 'std::f64', 'name': 'is_nan' }, diff --git a/tests/rustdoc-js-std/enum-option.js b/tests/rustdoc-js-std/enum-option.js index 902e0906910..216dafe3b12 100644 --- a/tests/rustdoc-js-std/enum-option.js +++ b/tests/rustdoc-js-std/enum-option.js @@ -1,6 +1,5 @@ -const QUERY = 'enum:Option'; - const EXPECTED = { + 'query': 'enum:Option', 'others': [ { 'path': 'std::option', 'name': 'Option' }, ], diff --git a/tests/rustdoc-js-std/filter-crate.js b/tests/rustdoc-js-std/filter-crate.js index b47a1fefa41..95f2969d299 100644 --- a/tests/rustdoc-js-std/filter-crate.js +++ b/tests/rustdoc-js-std/filter-crate.js @@ -1,9 +1,9 @@ // exact-check -const QUERY = '"hashmap"'; const FILTER_CRATE = 'core'; const EXPECTED = { + 'query': 'hashmap', 'others': [ ], }; diff --git a/tests/rustdoc-js-std/fn-forget.js b/tests/rustdoc-js-std/fn-forget.js index 66a5fcaa781..addecf4e44f 100644 --- a/tests/rustdoc-js-std/fn-forget.js +++ b/tests/rustdoc-js-std/fn-forget.js @@ -1,6 +1,5 @@ -const QUERY = 'fn:forget'; - const EXPECTED = { + 'query': 'fn:forget', 'others': [ { 'path': 'std::mem', 'name': 'forget' }, { 'path': 'std::fmt', 'name': 'format' }, diff --git a/tests/rustdoc-js-std/from_u.js b/tests/rustdoc-js-std/from_u.js index e3f3cd436aa..7c9375ba529 100644 --- a/tests/rustdoc-js-std/from_u.js +++ b/tests/rustdoc-js-std/from_u.js @@ -1,6 +1,5 @@ -const QUERY = 'from_u'; - const EXPECTED = { + 'query': 'from_u', 'others': [ { 'path': 'std::char', 'name': 'from_u32' }, { 'path': 'std::str', 'name': 'from_utf8' }, diff --git a/tests/rustdoc-js-std/keyword.js b/tests/rustdoc-js-std/keyword.js index 868ddd7b6dc..b85ba34138b 100644 --- a/tests/rustdoc-js-std/keyword.js +++ b/tests/rustdoc-js-std/keyword.js @@ -1,8 +1,7 @@ // ignore-order -const QUERY = 'fn'; - const EXPECTED = { + 'query': 'fn', 'others': [ { 'path': 'std', 'name': 'fn', ty: 15 }, // 15 is for primitive types { 'path': 'std', 'name': 'fn', ty: 21 }, // 21 is for keywords diff --git a/tests/rustdoc-js-std/macro-check.js b/tests/rustdoc-js-std/macro-check.js index 242e0cbf5f4..c22b1753fd7 100644 --- a/tests/rustdoc-js-std/macro-check.js +++ b/tests/rustdoc-js-std/macro-check.js @@ -1,8 +1,7 @@ // ignore-order -const QUERY = 'panic'; - const EXPECTED = { + 'query': 'panic', 'others': [ { 'path': 'std', 'name': 'panic', ty: 14 }, // 15 is for macros { 'path': 'std', 'name': 'panic', ty: 0 }, // 0 is for modules diff --git a/tests/rustdoc-js-std/macro-print.js b/tests/rustdoc-js-std/macro-print.js index 1b4c7b40570..2ef1c89e49b 100644 --- a/tests/rustdoc-js-std/macro-print.js +++ b/tests/rustdoc-js-std/macro-print.js @@ -1,6 +1,5 @@ -const QUERY = 'macro:print'; - const EXPECTED = { + 'query': 'macro:print', 'others': [ { 'path': 'std', 'name': 'print' }, { 'path': 'std', 'name': 'println' }, diff --git a/tests/rustdoc-js-std/never.js b/tests/rustdoc-js-std/never.js index 392b1e81837..ed3776b3c2a 100644 --- a/tests/rustdoc-js-std/never.js +++ b/tests/rustdoc-js-std/never.js @@ -1,6 +1,5 @@ -const QUERY = '!'; - const EXPECTED = { + 'query': '!', 'others': [ { 'path': 'std', 'name': 'never' }, ], diff --git a/tests/rustdoc-js-std/option-type-signatures.js b/tests/rustdoc-js-std/option-type-signatures.js index 6bf421a2135..8f6b0450dd3 100644 --- a/tests/rustdoc-js-std/option-type-signatures.js +++ b/tests/rustdoc-js-std/option-type-signatures.js @@ -1,15 +1,12 @@ -const QUERY = [ - 'option, fnonce -> option', - 'option -> default', -]; - const EXPECTED = [ { + 'query': 'option, fnonce -> option', 'others': [ { 'path': 'std::option::Option', 'name': 'map' }, ], }, { + 'query': 'option -> default', 'others': [ { 'path': 'std::option::Option', 'name': 'unwrap_or_default' }, { 'path': 'std::option::Option', 'name': 'get_or_insert_default' }, diff --git a/tests/rustdoc-js-std/parser-errors.js b/tests/rustdoc-js-std/parser-errors.js index d1aa840ab08..aa8ee86d672 100644 --- a/tests/rustdoc-js-std/parser-errors.js +++ b/tests/rustdoc-js-std/parser-errors.js @@ -1,50 +1,6 @@ -const QUERY = [ - '
', - '->
',
- 'a<"P">',
- '"P" "P"',
- 'P "P"',
- '"p" p',
- '"const": p',
- "a<:a>",
- "a<::a>",
- "((a))",
- "(p -> p",
- "::a::b",
- "a::::b",
- "a::b::",
- ":a",
- "a b:",
- "a (b:",
- "_:",
- "_:a",
- "a-bb",
- "a>bb",
- "ab'",
- "a->",
- '"p" ',
- '"p" a',
- "a,<",
- "aaaaa<>b",
- "fn:aaaaa<>b",
- "->a<>b",
- "a<->",
- "a:: a",
- "a ::a",
- "a:",
- "a<>:",
- "a,:",
- " a<> :",
- "mod : :",
- "a!a",
- "a!!",
- "mod:a!",
- "a!::a",
- "a<",
-];
-
const PARSED = [
{
+ query: ' ',
elems: [],
foundElems: 0,
original: " ",
@@ -53,6 +9,7 @@ const PARSED = [
error: "Found generics without a path",
},
{
+ query: '-> ',
elems: [],
foundElems: 0,
original: "-> ",
@@ -61,6 +18,7 @@ const PARSED = [
error: "Found generics without a path",
},
{
+ query: 'a<"P">',
elems: [],
foundElems: 0,
original: "a<\"P\">",
@@ -69,6 +27,7 @@ const PARSED = [
error: "Unexpected `\"` in generics",
},
{
+ query: '"P" "P"',
elems: [],
foundElems: 0,
original: "\"P\" \"P\"",
@@ -77,6 +36,7 @@ const PARSED = [
error: "Cannot have more than one literal search element",
},
{
+ query: 'P "P"',
elems: [],
foundElems: 0,
original: "P \"P\"",
@@ -85,6 +45,7 @@ const PARSED = [
error: "Cannot use literal search when there is more than one element",
},
{
+ query: '"p" p',
elems: [],
foundElems: 0,
original: "\"p\" p",
@@ -93,6 +54,7 @@ const PARSED = [
error: "You cannot have more than one element if you use quotes",
},
{
+ query: '"const": p',
elems: [],
foundElems: 0,
original: "\"const\": p",
@@ -101,6 +63,7 @@ const PARSED = [
error: "You cannot use quotes on type filter",
},
{
+ query: "a<:a>",
elems: [],
foundElems: 0,
original: "a<:a>",
@@ -109,6 +72,7 @@ const PARSED = [
error: "Expected type filter before `:`",
},
{
+ query: "a<::a>",
elems: [],
foundElems: 0,
original: "a<::a>",
@@ -117,6 +81,7 @@ const PARSED = [
error: "Unexpected `::`: paths cannot start with `::`",
},
{
+ query: "((a))",
elems: [],
foundElems: 0,
original: "((a))",
@@ -125,6 +90,7 @@ const PARSED = [
error: "Unexpected `(`",
},
{
+ query: "(p -> p",
elems: [],
foundElems: 0,
original: "(p -> p",
@@ -133,6 +99,7 @@ const PARSED = [
error: "Unexpected `(`",
},
{
+ query: "::a::b",
elems: [],
foundElems: 0,
original: "::a::b",
@@ -141,6 +108,7 @@ const PARSED = [
error: "Paths cannot start with `::`",
},
{
+ query: "a::::b",
elems: [],
foundElems: 0,
original: "a::::b",
@@ -149,6 +117,7 @@ const PARSED = [
error: "Unexpected `::::`",
},
{
+ query: "a::b::",
elems: [],
foundElems: 0,
original: "a::b::",
@@ -157,6 +126,7 @@ const PARSED = [
error: "Paths cannot end with `::`",
},
{
+ query: ":a",
elems: [],
foundElems: 0,
original: ":a",
@@ -165,6 +135,7 @@ const PARSED = [
error: "Expected type filter before `:`",
},
{
+ query: "a b:",
elems: [],
foundElems: 0,
original: "a b:",
@@ -173,6 +144,7 @@ const PARSED = [
error: "Unexpected `:` (expected path after type filter)",
},
{
+ query: "a (b:",
elems: [],
foundElems: 0,
original: "a (b:",
@@ -181,6 +153,7 @@ const PARSED = [
error: "Unexpected `(`",
},
{
+ query: "_:",
elems: [],
foundElems: 0,
original: "_:",
@@ -189,6 +162,7 @@ const PARSED = [
error: "Unexpected `:` (expected path after type filter)",
},
{
+ query: "_:a",
elems: [],
foundElems: 0,
original: "_:a",
@@ -197,6 +171,7 @@ const PARSED = [
error: "Unknown type filter `_`",
},
{
+ query: "a-bb",
elems: [],
foundElems: 0,
original: "a-bb",
@@ -205,6 +180,7 @@ const PARSED = [
error: "Unexpected `-` (did you mean `->`?)",
},
{
+ query: "a>bb",
elems: [],
foundElems: 0,
original: "a>bb",
@@ -213,6 +189,7 @@ const PARSED = [
error: "Unexpected `>` (did you mean `->`?)",
},
{
+ query: "ab'",
elems: [],
foundElems: 0,
original: "ab'",
@@ -221,6 +198,7 @@ const PARSED = [
error: "Unexpected `'`",
},
{
+ query: "a->",
elems: [],
foundElems: 0,
original: "a->",
@@ -229,6 +207,7 @@ const PARSED = [
error: "Expected at least one item after `->`",
},
{
+ query: '"p" ',
elems: [],
foundElems: 0,
original: '"p" ',
@@ -237,6 +216,7 @@ const PARSED = [
error: "Found generics without a path",
},
{
+ query: '"p" a',
elems: [],
foundElems: 0,
original: '"p" a',
@@ -245,6 +225,7 @@ const PARSED = [
error: "You cannot have more than one element if you use quotes",
},
{
+ query: "a,<",
elems: [],
foundElems: 0,
original: 'a,<',
@@ -253,6 +234,7 @@ const PARSED = [
error: 'Found generics without a path',
},
{
+ query: "aaaaa<>b",
elems: [],
foundElems: 0,
original: 'aaaaa<>b',
@@ -261,6 +243,7 @@ const PARSED = [
error: 'Expected `,`, ` `, `:` or `->`, found `b`',
},
{
+ query: "fn:aaaaa<>b",
elems: [],
foundElems: 0,
original: 'fn:aaaaa<>b',
@@ -269,6 +252,7 @@ const PARSED = [
error: 'Expected `,`, ` `, `:` or `->`, found `b`',
},
{
+ query: "->a<>b",
elems: [],
foundElems: 0,
original: '->a<>b',
@@ -277,6 +261,7 @@ const PARSED = [
error: 'Expected `,` or ` `, found `b`',
},
{
+ query: "a<->",
elems: [],
foundElems: 0,
original: 'a<->',
@@ -285,6 +270,7 @@ const PARSED = [
error: 'Unexpected `-` after `<`',
},
{
+ query: "a:: a",
elems: [],
foundElems: 0,
original: 'a:: a',
@@ -293,6 +279,7 @@ const PARSED = [
error: 'Paths cannot end with `::`',
},
{
+ query: "a ::a",
elems: [],
foundElems: 0,
original: 'a ::a',
@@ -301,6 +288,7 @@ const PARSED = [
error: 'Paths cannot start with `::`',
},
{
+ query: "a:",
elems: [],
foundElems: 0,
original: "a:",
@@ -309,6 +297,7 @@ const PARSED = [
error: 'Unexpected `<` in type filter',
},
{
+ query: "a<>:",
elems: [],
foundElems: 0,
original: "a<>:",
@@ -317,6 +306,7 @@ const PARSED = [
error: 'Unexpected `<` in type filter',
},
{
+ query: "a,:",
elems: [],
foundElems: 0,
original: "a,:",
@@ -325,6 +315,7 @@ const PARSED = [
error: 'Unexpected `,` in type filter',
},
{
+ query: " a<> :",
elems: [],
foundElems: 0,
original: "a<> :",
@@ -333,6 +324,7 @@ const PARSED = [
error: 'Unexpected `<` in type filter',
},
{
+ query: "mod : :",
elems: [],
foundElems: 0,
original: "mod : :",
@@ -341,6 +333,7 @@ const PARSED = [
error: 'Unexpected `:`',
},
{
+ query: "a!a",
elems: [],
foundElems: 0,
original: "a!a",
@@ -349,6 +342,7 @@ const PARSED = [
error: 'Unexpected `!`: it can only be at the end of an ident',
},
{
+ query: "a!!",
elems: [],
foundElems: 0,
original: "a!!",
@@ -357,6 +351,7 @@ const PARSED = [
error: 'Cannot have more than one `!` in an ident',
},
{
+ query: "mod:a!",
elems: [],
foundElems: 0,
original: "mod:a!",
@@ -365,6 +360,7 @@ const PARSED = [
error: 'Invalid search type: macro `!` and `mod` both specified',
},
{
+ query: "a!::a",
elems: [],
foundElems: 0,
original: "a!::a",
@@ -373,6 +369,7 @@ const PARSED = [
error: 'Cannot have associated items in macros',
},
{
+ query: "a<",
elems: [],
foundElems: 0,
original: "a<",
diff --git a/tests/rustdoc-js-std/parser-filter.js b/tests/rustdoc-js-std/parser-filter.js
index e23447ab75d..6f5d66e57ba 100644
--- a/tests/rustdoc-js-std/parser-filter.js
+++ b/tests/rustdoc-js-std/parser-filter.js
@@ -1,17 +1,6 @@
-const QUERY = [
- 'fn:foo',
- 'enum : foo',
- 'macro '];
-
const PARSED = [
{
+ query: 'R ',
elems: [{
name: "r",
fullPath: ["r"],
diff --git a/tests/rustdoc-js-std/parser-paths.js b/tests/rustdoc-js-std/parser-paths.js
index f3e421f5ffa..8d4dedf3f46 100644
--- a/tests/rustdoc-js-std/parser-paths.js
+++ b/tests/rustdoc-js-std/parser-paths.js
@@ -1,7 +1,6 @@
-const QUERY = ['A::B', 'A::B,C', 'A::B ",
- "-> P",
- "->,a",
- "aaaaa->a",
- "-> !",
-];
-
const PARSED = [
{
+ query: "-> F ",
elems: [],
foundElems: 1,
original: "-> F ",
@@ -31,6 +24,7 @@ const PARSED = [
error: null,
},
{
+ query: "-> P",
elems: [],
foundElems: 1,
original: "-> P",
@@ -46,6 +40,7 @@ const PARSED = [
error: null,
},
{
+ query: "->,a",
elems: [],
foundElems: 1,
original: "->,a",
@@ -61,6 +56,7 @@ const PARSED = [
error: null,
},
{
+ query: "aaaaa->a",
elems: [{
name: "aaaaa",
fullPath: ["aaaaa"],
@@ -83,6 +79,7 @@ const PARSED = [
error: null,
},
{
+ query: "-> !",
elems: [],
foundElems: 1,
original: "-> !",
diff --git a/tests/rustdoc-js-std/parser-separators.js b/tests/rustdoc-js-std/parser-separators.js
index fc8c5114c4e..69f9ac29ad3 100644
--- a/tests/rustdoc-js-std/parser-separators.js
+++ b/tests/rustdoc-js-std/parser-separators.js
@@ -1,17 +1,8 @@
// ignore-tidy-tab
-const QUERY = [
- 'aaaaaa b',
- 'a b',
- 'a,b',
- 'a\tb',
- 'a',
- 'a',
- 'a',
-];
-
const PARSED = [
{
+ query: 'aaaaaa b',
elems: [
{
name: 'aaaaaa',
@@ -37,6 +28,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a b',
elems: [
{
name: 'a',
@@ -62,6 +54,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a,b',
elems: [
{
name: 'a',
@@ -87,6 +80,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a\tb',
elems: [
{
name: 'a',
@@ -112,6 +106,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a',
elems: [
{
name: 'a',
@@ -144,6 +139,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a',
elems: [
{
name: 'a',
@@ -176,6 +172,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a',
elems: [
{
name: 'a',
diff --git a/tests/rustdoc-js-std/parser-weird-queries.js b/tests/rustdoc-js-std/parser-weird-queries.js
index dc1049a70bc..0e08eaf73c8 100644
--- a/tests/rustdoc-js-std/parser-weird-queries.js
+++ b/tests/rustdoc-js-std/parser-weird-queries.js
@@ -1,18 +1,10 @@
// This test is mostly to check that the parser still kinda outputs something
// (and doesn't enter an infinite loop!) even though the query is completely
// invalid.
-const QUERY = [
- 'a b',
- 'a b',
- 'a,b(c)',
- 'aaa,a',
- ',,,,',
- 'mod :',
- 'mod\t:',
-];
const PARSED = [
{
+ query: 'a b',
elems: [
{
name: "a",
@@ -38,6 +30,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a b',
elems: [
{
name: "a",
@@ -63,6 +56,7 @@ const PARSED = [
error: null,
},
{
+ query: 'a,b(c)',
elems: [],
foundElems: 0,
original: "a,b(c)",
@@ -71,6 +65,7 @@ const PARSED = [
error: "Unexpected `(`",
},
{
+ query: 'aaa,a',
elems: [
{
name: "aaa",
@@ -96,6 +91,7 @@ const PARSED = [
error: null,
},
{
+ query: ',,,,',
elems: [],
foundElems: 0,
original: ",,,,",
@@ -104,6 +100,7 @@ const PARSED = [
error: null,
},
{
+ query: 'mod :',
elems: [],
foundElems: 0,
original: 'mod :',
@@ -112,6 +109,7 @@ const PARSED = [
error: "Unexpected `:` (expected path after type filter)",
},
{
+ query: 'mod\t:',
elems: [],
foundElems: 0,
original: 'mod\t:',
diff --git a/tests/rustdoc-js-std/path-ordering.js b/tests/rustdoc-js-std/path-ordering.js
index 7dcdd402312..c3d61d238cc 100644
--- a/tests/rustdoc-js-std/path-ordering.js
+++ b/tests/rustdoc-js-std/path-ordering.js
@@ -1,7 +1,6 @@
-const QUERY = 'hashset::insert';
-
const EXPECTED = {
- 'others': [
+ query: 'hashset::insert',
+ others: [
// ensure hashset::insert comes first
{ 'path': 'std::collections::hash_set::HashSet', 'name': 'insert' },
{ 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert' },
diff --git a/tests/rustdoc-js-std/primitive.js b/tests/rustdoc-js-std/primitive.js
index e5690383e4f..737e429bf55 100644
--- a/tests/rustdoc-js-std/primitive.js
+++ b/tests/rustdoc-js-std/primitive.js
@@ -1,15 +1,6 @@
-const QUERY = [
- 'i8',
- 'u32',
- 'str',
- 'char',
- 'unit',
- 'tuple',
- 'fn',
-];
-
const EXPECTED = [
{
+ 'query': 'i8',
'others': [
{
'path': 'std',
@@ -19,6 +10,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'u32',
'others': [
{
'path': 'std',
@@ -28,6 +20,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'str',
'others': [
{
'path': 'std',
@@ -37,6 +30,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'char',
'others': [
{
'path': 'std',
@@ -46,6 +40,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'unit',
'others': [
{
'path': 'std',
@@ -55,6 +50,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'tuple',
'others': [
{
'path': 'std',
@@ -64,6 +60,7 @@ const EXPECTED = [
]
},
{
+ 'query': 'fn',
'others': [
{
'path': 'std',
diff --git a/tests/rustdoc-js-std/println-typo.js b/tests/rustdoc-js-std/println-typo.js
index 7ca3ab8e563..a4dd90a44d5 100644
--- a/tests/rustdoc-js-std/println-typo.js
+++ b/tests/rustdoc-js-std/println-typo.js
@@ -1,9 +1,9 @@
// exact-check
-const QUERY = 'prinltn';
const FILTER_CRATE = 'std';
const EXPECTED = {
+ 'query': 'prinltn',
'others': [
{ 'path': 'std', 'name': 'println' },
{ 'path': 'std', 'name': 'print' },
diff --git a/tests/rustdoc-js-std/quoted.js b/tests/rustdoc-js-std/quoted.js
index aec8484a41f..8a927501925 100644
--- a/tests/rustdoc-js-std/quoted.js
+++ b/tests/rustdoc-js-std/quoted.js
@@ -1,9 +1,9 @@
// ignore-order
-const QUERY = '"error"';
const FILTER_CRATE = 'std';
const EXPECTED = {
+ 'query': '"error"',
'others': [
{ 'path': 'std', 'name': 'error' },
{ 'path': 'std::fmt', 'name': 'Error' },
diff --git a/tests/rustdoc-js-std/reference-shrink.js b/tests/rustdoc-js-std/reference-shrink.js
index f90be6d1bfd..b602bbdca18 100644
--- a/tests/rustdoc-js-std/reference-shrink.js
+++ b/tests/rustdoc-js-std/reference-shrink.js
@@ -1,8 +1,7 @@
// exact-check
-const QUERY = 'reference::shrink';
-
const EXPECTED = {
+ 'query': 'reference::shrink',
// avoid including the method that's not going to be in the HTML
'others': [],
};
diff --git a/tests/rustdoc-js-std/regex.js b/tests/rustdoc-js-std/regex.js
index a6843c595f7..7dc38939a17 100644
--- a/tests/rustdoc-js-std/regex.js
+++ b/tests/rustdoc-js-std/regex.js
@@ -1,9 +1,8 @@
// exact-check
// https://github.com/rust-lang/rust/issues/103357
-const QUERY = 'regex';
-
const EXPECTED = {
+ 'query': 'regex',
'others': [],
'in_args': [],
'returned': [],
diff --git a/tests/rustdoc-js-std/return-specific-literal.js b/tests/rustdoc-js-std/return-specific-literal.js
index c7c347240b7..86ed3aceb4e 100644
--- a/tests/rustdoc-js-std/return-specific-literal.js
+++ b/tests/rustdoc-js-std/return-specific-literal.js
@@ -1,6 +1,5 @@
-const QUERY = 'struct:"string"';
-
const EXPECTED = {
+ 'query': 'struct:"string"',
'in_args': [
{ 'path': 'std::string::String', 'name': 'ne' },
],
diff --git a/tests/rustdoc-js-std/return-specific.js b/tests/rustdoc-js-std/return-specific.js
index d9a910553b8..be54a1c9772 100644
--- a/tests/rustdoc-js-std/return-specific.js
+++ b/tests/rustdoc-js-std/return-specific.js
@@ -1,6 +1,5 @@
-const QUERY = 'struct:string';
-
const EXPECTED = {
+ 'query': 'struct:string',
'in_args': [
{ 'path': 'std::string::String', 'name': 'ne' },
],
diff --git a/tests/rustdoc-js-std/should-fail.js b/tests/rustdoc-js-std/should-fail.js
index b85a47dc08a..94f82efd9b4 100644
--- a/tests/rustdoc-js-std/should-fail.js
+++ b/tests/rustdoc-js-std/should-fail.js
@@ -1,8 +1,7 @@
// should-fail
-const QUERY = 'fn';
-
const EXPECTED = {
+ 'query': 'fn',
'others': [
{ 'path': 'std', 'name': 'fn', ty: 14 },
],
diff --git a/tests/rustdoc-js-std/string-from_ut.js b/tests/rustdoc-js-std/string-from_ut.js
index f9edf4408db..1fff6ee28bb 100644
--- a/tests/rustdoc-js-std/string-from_ut.js
+++ b/tests/rustdoc-js-std/string-from_ut.js
@@ -1,6 +1,5 @@
-const QUERY = 'String::from_ut';
-
const EXPECTED = {
+ 'query': 'String::from_ut',
'others': [
{ 'path': 'std::string::String', 'name': 'from_utf8' },
{ 'path': 'std::string::String', 'name': 'from_utf8' },
diff --git a/tests/rustdoc-js-std/struct-vec.js b/tests/rustdoc-js-std/struct-vec.js
index 29609904b19..dd72aaa1ab8 100644
--- a/tests/rustdoc-js-std/struct-vec.js
+++ b/tests/rustdoc-js-std/struct-vec.js
@@ -1,6 +1,5 @@
-const QUERY = 'struct:VecD';
-
const EXPECTED = {
+ 'query': 'struct:VecD',
'others': [
{ 'path': 'std::collections', 'name': 'VecDeque' },
{ 'path': 'std::vec', 'name': 'Vec' },
diff --git a/tests/rustdoc-js-std/typed-query.js b/tests/rustdoc-js-std/typed-query.js
index eeb3e188869..8e84645889a 100644
--- a/tests/rustdoc-js-std/typed-query.js
+++ b/tests/rustdoc-js-std/typed-query.js
@@ -1,9 +1,9 @@
// exact-check
-const QUERY = 'macro:print';
const FILTER_CRATE = 'std';
const EXPECTED = {
+ 'query': 'macro:print',
'others': [
{ 'path': 'std', 'name': 'print' },
{ 'path': 'std', 'name': 'println' },
diff --git a/tests/rustdoc-js-std/vec-new.js b/tests/rustdoc-js-std/vec-new.js
index fc44a566af2..309f3543faf 100644
--- a/tests/rustdoc-js-std/vec-new.js
+++ b/tests/rustdoc-js-std/vec-new.js
@@ -1,6 +1,5 @@
-const QUERY = 'Vec::new';
-
const EXPECTED = {
+ 'query': 'Vec::new',
'others': [
{ 'path': 'std::vec::Vec', 'name': 'new' },
{ 'path': 'alloc::vec::Vec', 'name': 'new' },
diff --git a/tests/rustdoc-js/basic.js b/tests/rustdoc-js/basic.js
index d99b23468b6..e186d510887 100644
--- a/tests/rustdoc-js/basic.js
+++ b/tests/rustdoc-js/basic.js
@@ -1,6 +1,5 @@
-const QUERY = 'Fo';
-
const EXPECTED = {
+ 'query': 'Fo',
'others': [
{ 'path': 'basic', 'name': 'Foo' },
],
diff --git a/tests/rustdoc-js/doc-alias-filter-out.js b/tests/rustdoc-js/doc-alias-filter-out.js
index 46a089d06eb..fd25370dff3 100644
--- a/tests/rustdoc-js/doc-alias-filter-out.js
+++ b/tests/rustdoc-js/doc-alias-filter-out.js
@@ -1,9 +1,8 @@
// exact-check
-const QUERY = 'true';
-
const FILTER_CRATE = 'some_other_crate';
const EXPECTED = {
+ 'query': 'true',
'others': [],
};
diff --git a/tests/rustdoc-js/doc-alias-filter.js b/tests/rustdoc-js/doc-alias-filter.js
index e06047ba760..1d2dd8b9a8c 100644
--- a/tests/rustdoc-js/doc-alias-filter.js
+++ b/tests/rustdoc-js/doc-alias-filter.js
@@ -1,10 +1,9 @@
// exact-check
-const QUERY = '"true"';
-
const FILTER_CRATE = 'doc_alias_filter';
const EXPECTED = {
+ 'query': '"true"',
'others': [
{
'path': 'doc_alias_filter',
diff --git a/tests/rustdoc-js/doc-alias-whitespace.js b/tests/rustdoc-js/doc-alias-whitespace.js
index c9fc0c4311f..64784b5698b 100644
--- a/tests/rustdoc-js/doc-alias-whitespace.js
+++ b/tests/rustdoc-js/doc-alias-whitespace.js
@@ -1,11 +1,8 @@
// exact-check
-const QUERY = [
- 'Demon Lord',
-];
-
const EXPECTED = [
{
+ 'query': 'Demon Lord',
'others': [
{
'path': 'doc_alias_whitespace',
diff --git a/tests/rustdoc-js/doc-alias.js b/tests/rustdoc-js/doc-alias.js
index 62c8e7a74b9..7e4e8a776d8 100644
--- a/tests/rustdoc-js/doc-alias.js
+++ b/tests/rustdoc-js/doc-alias.js
@@ -1,31 +1,6 @@
-const QUERY = [
- 'StructItem',
- 'StructFieldItem',
- 'StructMethodItem',
- 'ImplTraitItem',
- 'StructImplConstItem',
- 'ImplTraitFunction',
- 'EnumItem',
- 'VariantItem',
- 'EnumMethodItem',
- 'TypedefItem',
- 'TraitItem',
- 'TraitTypeItem',
- 'AssociatedConstItem',
- 'TraitFunctionItem',
- 'FunctionItem',
- 'ModuleItem',
- 'ConstItem',
- 'StaticItem',
- 'UnionItem',
- 'UnionFieldItem',
- 'UnionMethodItem',
- 'MacroItem',
-];
-
const EXPECTED = [
{
- // StructItem
+ 'query': 'StructItem',
'others': [
{
'path': 'doc_alias',
@@ -37,7 +12,7 @@ const EXPECTED = [
],
},
{
- // StructFieldItem
+ 'query': 'StructFieldItem',
'others': [
{
'path': 'doc_alias::Struct',
@@ -49,7 +24,7 @@ const EXPECTED = [
],
},
{
- // StructMethodItem
+ 'query': 'StructMethodItem',
'others': [
{
'path': 'doc_alias::Struct',
@@ -61,11 +36,11 @@ const EXPECTED = [
],
},
{
- // ImplTraitItem
+ 'query': 'ImplTraitItem',
'others': [],
},
{
- // StructImplConstItem
+ 'query': 'StructImplConstItem',
'others': [
{
'path': 'doc_alias::Struct',
@@ -77,7 +52,7 @@ const EXPECTED = [
],
},
{
- // ImplTraitFunction
+ 'query': 'ImplTraitFunction',
'others': [
{
'path': 'doc_alias::Struct',
@@ -89,7 +64,7 @@ const EXPECTED = [
],
},
{
- // EnumItem
+ 'query': 'EnumItem',
'others': [
{
'path': 'doc_alias',
@@ -101,7 +76,7 @@ const EXPECTED = [
],
},
{
- // VariantItem
+ 'query': 'VariantItem',
'others': [
{
'path': 'doc_alias::Enum',
@@ -113,7 +88,7 @@ const EXPECTED = [
],
},
{
- // EnumMethodItem
+ 'query': 'EnumMethodItem',
'others': [
{
'path': 'doc_alias::Enum',
@@ -125,7 +100,7 @@ const EXPECTED = [
],
},
{
- // TypedefItem
+ 'query': 'TypedefItem',
'others': [
{
'path': 'doc_alias',
@@ -137,7 +112,7 @@ const EXPECTED = [
],
},
{
- // TraitItem
+ 'query': 'TraitItem',
'others': [
{
'path': 'doc_alias',
@@ -149,7 +124,7 @@ const EXPECTED = [
],
},
{
- // TraitTypeItem
+ 'query': 'TraitTypeItem',
'others': [
{
'path': 'doc_alias::Trait',
@@ -161,7 +136,7 @@ const EXPECTED = [
],
},
{
- // AssociatedConstItem
+ 'query': 'AssociatedConstItem',
'others': [
{
'path': 'doc_alias::Trait',
@@ -173,7 +148,7 @@ const EXPECTED = [
],
},
{
- // TraitFunctionItem
+ 'query': 'TraitFunctionItem',
'others': [
{
'path': 'doc_alias::Trait',
@@ -185,7 +160,7 @@ const EXPECTED = [
],
},
{
- // FunctionItem
+ 'query': 'FunctionItem',
'others': [
{
'path': 'doc_alias',
@@ -197,7 +172,7 @@ const EXPECTED = [
],
},
{
- // ModuleItem
+ 'query': 'ModuleItem',
'others': [
{
'path': 'doc_alias',
@@ -209,7 +184,7 @@ const EXPECTED = [
],
},
{
- // ConstItem
+ 'query': 'ConstItem',
'others': [
{
'path': 'doc_alias',
@@ -225,7 +200,7 @@ const EXPECTED = [
],
},
{
- // StaticItem
+ 'query': 'StaticItem',
'others': [
{
'path': 'doc_alias',
@@ -237,7 +212,7 @@ const EXPECTED = [
],
},
{
- // UnionItem
+ 'query': 'UnionItem',
'others': [
{
'path': 'doc_alias',
@@ -255,7 +230,7 @@ const EXPECTED = [
],
},
{
- // UnionFieldItem
+ 'query': 'UnionFieldItem',
'others': [
{
'path': 'doc_alias::Union',
@@ -267,7 +242,7 @@ const EXPECTED = [
],
},
{
- // UnionMethodItem
+ 'query': 'UnionMethodItem',
'others': [
{
'path': 'doc_alias::Union',
@@ -279,7 +254,7 @@ const EXPECTED = [
],
},
{
- // MacroItem
+ 'query': 'MacroItem',
'others': [
{
'path': 'doc_alias',
diff --git a/tests/rustdoc-js/exact-match.js b/tests/rustdoc-js/exact-match.js
index b0a411bee58..ce3a76f9b7d 100644
--- a/tests/rustdoc-js/exact-match.js
+++ b/tests/rustdoc-js/exact-match.js
@@ -1,6 +1,5 @@
-const QUERY = 'si::pc';
-
const EXPECTED = {
+ 'query': 'si::pc',
'others': [
{ 'path': 'exact_match::Si', 'name': 'pc' },
{ 'path': 'exact_match::Psi', 'name': 'pc' },
diff --git a/tests/rustdoc-js/foreign-type-path.js b/tests/rustdoc-js/foreign-type-path.js
index 334761badca..b11123d3ed9 100644
--- a/tests/rustdoc-js/foreign-type-path.js
+++ b/tests/rustdoc-js/foreign-type-path.js
@@ -1,6 +1,5 @@
-const QUERY = 'MyForeignType::my_method';
-
const EXPECTED = {
+ 'query': 'MyForeignType::my_method',
'others': [
// Test case for https://github.com/rust-lang/rust/pull/96887#pullrequestreview-967154358
// Validates that the parent path for a foreign type method is correct.
diff --git a/tests/rustdoc-js/generics-impl.js b/tests/rustdoc-js/generics-impl.js
index 5051743bda2..5e33e224876 100644
--- a/tests/rustdoc-js/generics-impl.js
+++ b/tests/rustdoc-js/generics-impl.js
@@ -1,68 +1,56 @@
// exact-check
-const QUERY = [
- 'Aaaaaaa -> u32',
- 'Aaaaaaa -> bool',
- 'Aaaaaaa -> usize',
- 'Read -> u64',
- 'trait:Read -> u64',
- 'struct:Read -> u64',
- 'bool -> u64',
- 'Ddddddd -> u64',
- '-> Ddddddd'
-];
-
const EXPECTED = [
{
- // Aaaaaaa -> u32
+ 'query': 'Aaaaaaa -> u32',
'others': [
{ 'path': 'generics_impl::Aaaaaaa', 'name': 'bbbbbbb' },
],
},
{
- // Aaaaaaa -> bool
+ 'query': 'Aaaaaaa -> bool',
'others': [
{ 'path': 'generics_impl::Aaaaaaa', 'name': 'ccccccc' },
],
},
{
- // Aaaaaaa -> usize
+ 'query': 'Aaaaaaa -> usize',
'others': [
{ 'path': 'generics_impl::Aaaaaaa', 'name': 'read' },
],
},
{
- // Read -> u64
+ 'query': 'Read -> u64',
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'eeeeeee' },
{ 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' },
],
},
{
- // trait:Read -> u64
+ 'query': 'trait:Read -> u64',
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'eeeeeee' },
{ 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' },
],
},
{
- // struct:Read -> u64
+ 'query': 'struct:Read -> u64',
'others': [],
},
{
- // bool -> u64
+ 'query': 'bool -> u64',
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'fffffff' },
],
},
{
- // Ddddddd -> u64
+ 'query': 'Ddddddd -> u64',
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'ggggggg' },
],
},
{
- // -> Ddddddd
+ 'query': '-> Ddddddd',
'others': [
{ 'path': 'generics_impl::Ddddddd', 'name': 'hhhhhhh' },
],
diff --git a/tests/rustdoc-js/generics-multi-trait.js b/tests/rustdoc-js/generics-multi-trait.js
index e7fcea876c8..7097cabe7a2 100644
--- a/tests/rustdoc-js/generics-multi-trait.js
+++ b/tests/rustdoc-js/generics-multi-trait.js
@@ -1,14 +1,9 @@
// exact-check
-const QUERY = [
- 'Result ',
- 'R
+ 'query': 'R ',
'returned': [
{ 'path': 'generics', 'name': 'alef' },
],
@@ -23,7 +11,7 @@ const EXPECTED = [
],
},
{
- // Rcode
], and Sidebar2
intra-doc.' },
],
},
{
+ 'query': 'summaries::Sidebar',
'others': [
{ 'path': 'summaries', 'name': 'Sidebar', 'desc': 'This code
will be rendered in a code tag.' },
],
},
{
+ 'query': 'summaries::Sidebar2',
'others': [
{ 'path': 'summaries', 'name': 'Sidebar2', 'desc': '' },
],
diff --git a/tests/rustdoc-js/where-clause.js b/tests/rustdoc-js/where-clause.js
index 86254a80e20..8dccf197be0 100644
--- a/tests/rustdoc-js/where-clause.js
+++ b/tests/rustdoc-js/where-clause.js
@@ -1,28 +1,31 @@
-const QUERY = ['trait