]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-js-std/parser-quote.js
Add parser tests
[rust.git] / src / test / rustdoc-js-std / parser-quote.js
1 const QUERY = ['-> "p"', '"const": "p"', '("p")', '"p"<p>'];
2
3 const PARSED = [
4     {
5         args: [],
6         elemName: null,
7         elems: [],
8         foundElems: 1,
9         id: "-> \"p\"",
10         nameSplit: null,
11         original: "-> \"p\"",
12         returned: [{
13             name: "p",
14             fullPath: ["p"],
15             pathWithoutLast: [],
16             pathLast: "p",
17             generics: [],
18         }],
19         typeFilter: -1,
20         val: "-> \"p\"",
21         error: null,
22     },
23     // This one checks that if quotes are used on the type filter, they're
24     // simply ignored.
25     {
26         args: [],
27         elemName: null,
28         elems: [{
29             name: "p",
30             fullPath: ["p"],
31             pathWithoutLast: [],
32             pathLast: "p",
33             generics: [],
34         }],
35         foundElems: 1,
36         id: "\"const\": \"p\"",
37         nameSplit: null,
38         original: "\"const\": \"p\"",
39         returned: [],
40         typeFilter: 17,
41         val: "\"const\": \"p\"",
42         error: null,
43     },
44     {
45         args: [{
46             name: "p",
47             fullPath: ["p"],
48             pathWithoutLast: [],
49             pathLast: "p",
50             generics: [],
51         }],
52         elemName: null,
53         elems: [],
54         foundElems: 1,
55         id: "(\"p\")",
56         nameSplit: null,
57         original: "(\"p\")",
58         returned: [],
59         typeFilter: -1,
60         val: "(\"p\")",
61         error: null,
62     },
63     // This test checks that a literal item can still have generics.
64     {
65         args: [],
66         elemName: null,
67         elems: [{
68             name: "p",
69             fullPath: ["p"],
70             pathWithoutLast: [],
71             pathLast: "p",
72             generics: [{
73                 name: "p",
74                 fullPath: ["p"],
75                 pathWithoutLast: [],
76                 pathLast: "p",
77                 generics: [],
78             }],
79         }],
80         foundElems: 1,
81         id: "\"p\"<p>",
82         nameSplit: null,
83         original: "\"p\"<p>",
84         returned: [],
85         typeFilter: -1,
86         val: "\"p\"<p>",
87         error: null,
88     },
89 ];