From f5833e759ecd55c03afeb918263cb35fabc91177 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 20 Dec 2021 17:45:52 +0100 Subject: Add parser tests --- src/test/rustdoc-js-std/parser-errors.js | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/test/rustdoc-js-std/parser-errors.js (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 new file mode 100644 index 00000000000..98be691e0e7 --- /dev/null +++ b/src/test/rustdoc-js-std/parser-errors.js @@ -0,0 +1,43 @@ +const QUERY = ['<"P">', '"P" "P"', 'P "P"']; + +const PARSED = [ + { + args: [], + elemName: null, + elems: [], + foundElems: 0, + id: "<\"P\">", + nameSplit: null, + original: "<\"P\">", + returned: [], + typeFilter: null, + val: "<\"p\">", + error: "`\"` cannot be used in generics", + }, + { + args: [], + elemName: null, + elems: [], + foundElems: 0, + id: "\"P\" \"P\"", + nameSplit: null, + original: "\"P\" \"P\"", + returned: [], + typeFilter: null, + val: "\"p\" \"p\"", + error: "Cannot have more than one literal search element", + }, + { + args: [], + elemName: null, + elems: [], + foundElems: 0, + id: "P \"P\"", + nameSplit: null, + original: "P \"P\"", + returned: [], + typeFilter: null, + val: "p \"p\"", + error: "Cannot use literal search when there is more than one element", + }, +]; -- cgit 1.4.1-3-g733a5