From 344d0b27d2a3b1d955be100a2bbe7da720aa8ff2 Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Tue, 5 Oct 2021 23:51:30 +0200 Subject: [PATCH] Added even more language tests (#3137) --- tests/languages/bicep/property_feature.test | 23 +++++++++ tests/languages/clojure/string_feature.test | 4 +- .../gn/builtin-function_feature.test | 49 +++++++++++++++++++ tests/languages/gn/constant_feature.test | 31 ++++++++++++ tests/languages/gn/keyword_feature.test | 9 ++++ .../languages/graphql/atom-input_feature.test | 7 +++ tests/languages/graphql/mutation_feature.test | 10 ++++ tests/languages/graphql/scalar_feature.test | 15 ++++++ .../control-flow_feature.test | 35 +++++++++++++ .../exports_feature.test | 26 +++++++++- .../javascript!+js-extras/nil_feature.test | 9 ++++ tests/languages/magma/shell_feature.test | 9 ++++ tests/languages/tremor/function_feature.test | 9 ++++ tests/languages/wolfram/black_feature.test | 9 ++++ tests/languages/wolfram/context_feature.test | 9 ++++ tests/languages/wolfram/keyword_feature.test | 41 ++++++++++++++++ tests/languages/wren/constant_feature.test | 7 +++ 17 files changed, 299 insertions(+), 3 deletions(-) create mode 100644 tests/languages/bicep/property_feature.test create mode 100644 tests/languages/gn/builtin-function_feature.test create mode 100644 tests/languages/gn/constant_feature.test create mode 100644 tests/languages/gn/keyword_feature.test create mode 100644 tests/languages/graphql/atom-input_feature.test create mode 100644 tests/languages/graphql/mutation_feature.test create mode 100644 tests/languages/graphql/scalar_feature.test create mode 100644 tests/languages/javascript!+js-extras/control-flow_feature.test create mode 100644 tests/languages/javascript!+js-extras/nil_feature.test create mode 100644 tests/languages/magma/shell_feature.test create mode 100644 tests/languages/tremor/function_feature.test create mode 100644 tests/languages/wolfram/black_feature.test create mode 100644 tests/languages/wolfram/context_feature.test create mode 100644 tests/languages/wolfram/keyword_feature.test create mode 100644 tests/languages/wren/constant_feature.test diff --git a/tests/languages/bicep/property_feature.test b/tests/languages/bicep/property_feature.test new file mode 100644 index 0000000000..4bb02cdde2 --- /dev/null +++ b/tests/languages/bicep/property_feature.test @@ -0,0 +1,23 @@ +var myObjWithSpecialChars = { + '$special\tchars!': true + normalKey: 'val' +} + +---------------------------------------------------- + +[ + ["keyword", "var"], + " myObjWithSpecialChars ", + ["operator", "="], + ["punctuation", "{"], + + ["property", "'$special\\tchars!'"], + ["operator", ":"], + ["boolean", "true"], + + ["property", "normalKey"], + ["operator", ":"], + ["string", "'val'"], + + ["punctuation", "}"] +] diff --git a/tests/languages/clojure/string_feature.test b/tests/languages/clojure/string_feature.test index 03738e8cb7..e715134cf0 100644 --- a/tests/languages/clojure/string_feature.test +++ b/tests/languages/clojure/string_feature.test @@ -2,13 +2,15 @@ "Fo\"obar" "multi-line string" +\NewLine ---------------------------------------------------- [ ["string", "\"\""], ["string", "\"Fo\\\"obar\""], - ["string", "\"multi-line\r\nstring\""] + ["string", "\"multi-line\r\nstring\""], + ["string", "\\NewLine"] ] ---------------------------------------------------- diff --git a/tests/languages/gn/builtin-function_feature.test b/tests/languages/gn/builtin-function_feature.test new file mode 100644 index 0000000000..f167f9aeec --- /dev/null +++ b/tests/languages/gn/builtin-function_feature.test @@ -0,0 +1,49 @@ +assert() +defined() +foreach() +import() +pool() +print() +template() +tool() +toolchain() + +---------------------------------------------------- + +[ + ["builtin-function", "assert"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "defined"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "foreach"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "import"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "pool"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "print"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "template"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "tool"], + ["punctuation", "("], + ["punctuation", ")"], + + ["builtin-function", "toolchain"], + ["punctuation", "("], + ["punctuation", ")"] +] diff --git a/tests/languages/gn/constant_feature.test b/tests/languages/gn/constant_feature.test new file mode 100644 index 0000000000..0992f0378f --- /dev/null +++ b/tests/languages/gn/constant_feature.test @@ -0,0 +1,31 @@ +current_cpu +current_os +current_toolchain +default_toolchain +host_cpu +host_os +root_build_dir +root_gen_dir +root_out_dir +target_cpu +target_gen_dir +target_os +target_out_dir + +---------------------------------------------------- + +[ + ["constant", "current_cpu"], + ["constant", "current_os"], + ["constant", "current_toolchain"], + ["constant", "default_toolchain"], + ["constant", "host_cpu"], + ["constant", "host_os"], + ["constant", "root_build_dir"], + ["constant", "root_gen_dir"], + ["constant", "root_out_dir"], + ["constant", "target_cpu"], + ["constant", "target_gen_dir"], + ["constant", "target_os"], + ["constant", "target_out_dir"] +] diff --git a/tests/languages/gn/keyword_feature.test b/tests/languages/gn/keyword_feature.test new file mode 100644 index 0000000000..8eaf16e7ff --- /dev/null +++ b/tests/languages/gn/keyword_feature.test @@ -0,0 +1,9 @@ +if +else + +---------------------------------------------------- + +[ + ["keyword", "if"], + ["keyword", "else"] +] diff --git a/tests/languages/graphql/atom-input_feature.test b/tests/languages/graphql/atom-input_feature.test new file mode 100644 index 0000000000..aae416211f --- /dev/null +++ b/tests/languages/graphql/atom-input_feature.test @@ -0,0 +1,7 @@ +FooInput + +---------------------------------------------------- + +[ + ["atom-input", "FooInput"] +] diff --git a/tests/languages/graphql/mutation_feature.test b/tests/languages/graphql/mutation_feature.test new file mode 100644 index 0000000000..658a9c0ff8 --- /dev/null +++ b/tests/languages/graphql/mutation_feature.test @@ -0,0 +1,10 @@ +mutation foo {} + +---------------------------------------------------- + +[ + ["keyword", "mutation"], + ["definition-mutation", "foo"], + ["punctuation", "{"], + ["punctuation", "}"] +] diff --git a/tests/languages/graphql/scalar_feature.test b/tests/languages/graphql/scalar_feature.test new file mode 100644 index 0000000000..3a4f400ac4 --- /dev/null +++ b/tests/languages/graphql/scalar_feature.test @@ -0,0 +1,15 @@ +Boolean +Float +ID +Int +String + +---------------------------------------------------- + +[ + ["scalar", "Boolean"], + ["scalar", "Float"], + ["scalar", "ID"], + ["scalar", "Int"], + ["scalar", "String"] +] diff --git a/tests/languages/javascript!+js-extras/control-flow_feature.test b/tests/languages/javascript!+js-extras/control-flow_feature.test new file mode 100644 index 0000000000..7dd9d4683d --- /dev/null +++ b/tests/languages/javascript!+js-extras/control-flow_feature.test @@ -0,0 +1,35 @@ +await +break +catch +continue +do +else +finally +for +if +return +switch +throw +try +while +yield + +---------------------------------------------------- + +[ + ["keyword", "await"], + ["keyword", "break"], + ["keyword", "catch"], + ["keyword", "continue"], + ["keyword", "do"], + ["keyword", "else"], + ["keyword", "finally"], + ["keyword", "for"], + ["keyword", "if"], + ["keyword", "return"], + ["keyword", "switch"], + ["keyword", "throw"], + ["keyword", "try"], + ["keyword", "while"], + ["keyword", "yield"] +] diff --git a/tests/languages/javascript!+js-extras/exports_feature.test b/tests/languages/javascript!+js-extras/exports_feature.test index 67b7647bbb..4c7aa50c4f 100644 --- a/tests/languages/javascript!+js-extras/exports_feature.test +++ b/tests/languages/javascript!+js-extras/exports_feature.test @@ -12,6 +12,7 @@ export {d} export {d,} export {d as Foo, b as Bar} export {d as Foo, b as Bar,} +export default function() { } ---------------------------------------------------- @@ -23,6 +24,7 @@ export {d as Foo, b as Bar,} ["keyword", "from"], ["string", "\"mod\""], ["punctuation", ";"], + ["keyword", "export"], ["exports", [ ["operator", "*"], @@ -32,6 +34,7 @@ export {d as Foo, b as Bar,} ["keyword", "from"], ["string", "\"mod\""], ["punctuation", ";"], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], @@ -40,6 +43,7 @@ export {d as Foo, b as Bar,} ["keyword", "from"], ["string", "\"mod\""], ["punctuation", ";"], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], @@ -49,6 +53,7 @@ export {d as Foo, b as Bar,} ["keyword", "from"], ["string", "\"mod\""], ["punctuation", ";"], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], @@ -58,6 +63,7 @@ export {d as Foo, b as Bar,} ["keyword", "from"], ["string", "\"mod\""], ["punctuation", ";"], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], @@ -68,6 +74,7 @@ export {d as Foo, b as Bar,} ["keyword", "from"], ["string", "\"mod\""], ["punctuation", ";"], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], @@ -83,6 +90,7 @@ export {d as Foo, b as Bar,} ["keyword", "from"], ["string", "\"mod\""], ["punctuation", ";"], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], @@ -99,23 +107,27 @@ export {d as Foo, b as Bar,} ["keyword", "from"], ["string", "\"mod\""], ["punctuation", ";"], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], ["punctuation", "}"] ]], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], "x", ["punctuation", "}"] ]], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], "d", ["punctuation", "}"] ]], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], @@ -123,6 +135,7 @@ export {d as Foo, b as Bar,} ["punctuation", ","], ["punctuation", "}"] ]], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], @@ -135,6 +148,7 @@ export {d as Foo, b as Bar,} ["maybe-class-name", "Bar"], ["punctuation", "}"] ]], + ["keyword", "export"], ["exports", [ ["punctuation", "{"], @@ -147,5 +161,13 @@ export {d as Foo, b as Bar,} ["maybe-class-name", "Bar"], ["punctuation", ","], ["punctuation", "}"] - ]] -] \ No newline at end of file + ]], + + ["keyword", "export"], + ["keyword", "default"], + ["keyword", "function"], + ["punctuation", "("], + ["punctuation", ")"], + ["punctuation", "{"], + ["punctuation", "}"] +] diff --git a/tests/languages/javascript!+js-extras/nil_feature.test b/tests/languages/javascript!+js-extras/nil_feature.test new file mode 100644 index 0000000000..e5dded24a4 --- /dev/null +++ b/tests/languages/javascript!+js-extras/nil_feature.test @@ -0,0 +1,9 @@ +null +undefined + +---------------------------------------------------- + +[ + ["keyword", "null"], + ["keyword", "undefined"] +] diff --git a/tests/languages/magma/shell_feature.test b/tests/languages/magma/shell_feature.test new file mode 100644 index 0000000000..2ef308c6f5 --- /dev/null +++ b/tests/languages/magma/shell_feature.test @@ -0,0 +1,9 @@ +> 1 +1 + +---------------------------------------------------- + +[ + ["punctuation", ">"], ["number", "1"], + ["output", "1"] +] diff --git a/tests/languages/tremor/function_feature.test b/tests/languages/tremor/function_feature.test new file mode 100644 index 0000000000..896990e8e7 --- /dev/null +++ b/tests/languages/tremor/function_feature.test @@ -0,0 +1,9 @@ +foo() + +---------------------------------------------------- + +[ + ["function", "foo"], + ["punctuation", "("], + ["punctuation", ")"] +] diff --git a/tests/languages/wolfram/black_feature.test b/tests/languages/wolfram/black_feature.test new file mode 100644 index 0000000000..33d87d5ed2 --- /dev/null +++ b/tests/languages/wolfram/black_feature.test @@ -0,0 +1,9 @@ +__ +x__ + +---------------------------------------------------- + +[ + ["blank", "__"], + ["blank", "x__"] +] diff --git a/tests/languages/wolfram/context_feature.test b/tests/languages/wolfram/context_feature.test new file mode 100644 index 0000000000..871beb18c9 --- /dev/null +++ b/tests/languages/wolfram/context_feature.test @@ -0,0 +1,9 @@ +Global` +System`Foo + +---------------------------------------------------- + +[ + ["context", "Global`"], + ["context", "System`Foo"] +] diff --git a/tests/languages/wolfram/keyword_feature.test b/tests/languages/wolfram/keyword_feature.test new file mode 100644 index 0000000000..88144e0799 --- /dev/null +++ b/tests/languages/wolfram/keyword_feature.test @@ -0,0 +1,41 @@ +Abs +AbsArg +Accuracy +Block +Do +For +Function +If +Manipulate +Module +Nest +NestList +None +Return +Switch +Table +Which +While + +---------------------------------------------------- + +[ + ["keyword", "Abs"], + ["keyword", "AbsArg"], + ["keyword", "Accuracy"], + ["keyword", "Block"], + ["keyword", "Do"], + ["keyword", "For"], + ["keyword", "Function"], + ["keyword", "If"], + ["keyword", "Manipulate"], + ["keyword", "Module"], + ["keyword", "Nest"], + ["keyword", "NestList"], + ["keyword", "None"], + ["keyword", "Return"], + ["keyword", "Switch"], + ["keyword", "Table"], + ["keyword", "Which"], + ["keyword", "While"] +] diff --git a/tests/languages/wren/constant_feature.test b/tests/languages/wren/constant_feature.test new file mode 100644 index 0000000000..49adc66704 --- /dev/null +++ b/tests/languages/wren/constant_feature.test @@ -0,0 +1,7 @@ +FOO + +---------------------------------------------------- + +[ + ["constant", "FOO"] +]