From 51de26cfd977edc7b0dc5450474a840359a79443 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 3 Jan 2022 23:51:20 +0100 Subject: * If type filter is in quotes, throw an error. * If there are generics, don't allow to have quotes. --- src/test/rustdoc-js-std/parser-errors.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/test/rustdoc-js-std/parser-errors.js') diff --git a/src/test/rustdoc-js-std/parser-errors.js b/src/test/rustdoc-js-std/parser-errors.js index b789fd05d7c..c5d106120ad 100644 --- a/src/test/rustdoc-js-std/parser-errors.js +++ b/src/test/rustdoc-js-std/parser-errors.js @@ -1,4 +1,4 @@ -const QUERY = ['<"P">', '"P" "P"', 'P "P"']; +const QUERY = ['<"P">', '"P" "P"', 'P "P"', '"p" p', '"const": p']; const PARSED = [ { @@ -40,4 +40,30 @@ const PARSED = [ userQuery: "p \"p\"", error: "Cannot use literal search when there is more than one element", }, + { + args: [], + elemName: null, + elems: [], + foundElems: 0, + id: "\"p\" p", + nameSplit: null, + original: "\"p\" p", + returned: [], + typeFilter: null, + userQuery: "\"p\" p", + error: "You cannot have more than one element if you use quotes", + }, + { + args: [], + elemName: null, + elems: [], + foundElems: 0, + id: "\"const\": p", + nameSplit: null, + original: "\"const\": p", + returned: [], + typeFilter: null, + userQuery: "\"const\": p", + error: "You cannot use quotes on type filter", + }, ]; -- cgit 1.4.1-3-g733a5