diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-03-20 15:03:17 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-04-18 20:59:09 +0200 |
| commit | 699ae365dfadabb3d26f957341a9f176d73bc8af (patch) | |
| tree | 1dbb52f4b0a7990602b1577142b7d36b750cad7f /src/test/rustdoc-js-std/parser-errors.js | |
| parent | c7de1a16f89b9aa3205f50c9cf2b9f6792ac6e4b (diff) | |
| download | rust-699ae365dfadabb3d26f957341a9f176d73bc8af.tar.gz rust-699ae365dfadabb3d26f957341a9f176d73bc8af.zip | |
Apply suggestions:
* Forbid generics without a path (so "<p>" is forbidden). * Change `handleSingleArg` so that it takes `results_others`, `results_in_args` and `results_returned` as arguments instead of using the "global" variables. * Change `createQueryElement` so that it returns the newly created element instead of taking `elems` as argument. * Improve documentation
Diffstat (limited to 'src/test/rustdoc-js-std/parser-errors.js')
| -rw-r--r-- | src/test/rustdoc-js-std/parser-errors.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/test/rustdoc-js-std/parser-errors.js b/src/test/rustdoc-js-std/parser-errors.js index d4cd9facf17..080f82b41ec 100644 --- a/src/test/rustdoc-js-std/parser-errors.js +++ b/src/test/rustdoc-js-std/parser-errors.js @@ -1,4 +1,6 @@ const QUERY = [ + '<P>', + '-> <P>', '<"P">', '"P" "P"', 'P "P"', @@ -16,12 +18,32 @@ const QUERY = [ "a b:", "a (b:", "{:", + "a-bb", + "a>bb", ]; const PARSED = [ { elems: [], foundElems: 0, + original: "<P>", + returned: [], + typeFilter: -1, + userQuery: "<p>", + error: "Found generics without a path", + }, + { + elems: [], + foundElems: 0, + original: "-> <P>", + returned: [], + typeFilter: -1, + userQuery: "-> <p>", + error: "Found generics without a path", + }, + { + elems: [], + foundElems: 0, original: "<\"P\">", returned: [], typeFilter: -1, @@ -172,4 +194,22 @@ const PARSED = [ userQuery: "{:", error: "Unknown type filter `{`", }, + { + elems: [], + foundElems: 0, + original: "a-bb", + returned: [], + typeFilter: -1, + userQuery: "a-bb", + error: "Unexpected `-` (did you mean `->`?)", + }, + { + elems: [], + foundElems: 0, + original: "a>bb", + returned: [], + typeFilter: -1, + userQuery: "a>bb", + error: "Unexpected `>` (did you mean `->`?)", + }, ]; |
