summaryrefslogtreecommitdiffstats
path: root/tests/snippets/js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/snippets/js/super.txt72
-rw-r--r--tests/snippets/jslt/test_sample.txt83
-rw-r--r--tests/snippets/json/test_basic.txt30
-rw-r--r--tests/snippets/json/test_basic_bare.txt23
4 files changed, 208 insertions, 0 deletions
diff --git a/tests/snippets/js/super.txt b/tests/snippets/js/super.txt
new file mode 100644
index 0000000..1af2ad2
--- /dev/null
+++ b/tests/snippets/js/super.txt
@@ -0,0 +1,72 @@
+---input---
+super(member1, member2)
+
+super(member1,member2)
+
+super(member1,
+member2)
+
+super (member1, member2)
+
+super (member1,member2)
+
+super (member1,
+member2)
+
+---tokens---
+'super' Keyword
+'(' Punctuation
+'member1' Name.Other
+',' Punctuation
+' ' Text.Whitespace
+'member2' Name.Other
+')' Punctuation
+'\n\n' Text.Whitespace
+
+'super' Keyword
+'(' Punctuation
+'member1' Name.Other
+',' Punctuation
+'member2' Name.Other
+')' Punctuation
+'\n\n' Text.Whitespace
+
+'super' Keyword
+'(' Punctuation
+'member1' Name.Other
+',' Punctuation
+'\n' Text.Whitespace
+
+'member2' Name.Other
+')' Punctuation
+'\n\n' Text.Whitespace
+
+'super' Keyword
+' ' Text.Whitespace
+'(' Punctuation
+'member1' Name.Other
+',' Punctuation
+' ' Text.Whitespace
+'member2' Name.Other
+')' Punctuation
+'\n\n' Text.Whitespace
+
+'super' Keyword
+' ' Text.Whitespace
+'(' Punctuation
+'member1' Name.Other
+',' Punctuation
+'member2' Name.Other
+')' Punctuation
+'\n\n' Text.Whitespace
+
+'super' Keyword
+' ' Text.Whitespace
+'(' Punctuation
+'member1' Name.Other
+',' Punctuation
+'\n' Text.Whitespace
+
+'member2' Name.Other
+')' Punctuation
+'\n' Text.Whitespace
diff --git a/tests/snippets/jslt/test_sample.txt b/tests/snippets/jslt/test_sample.txt
new file mode 100644
index 0000000..73ad3fd
--- /dev/null
+++ b/tests/snippets/jslt/test_sample.txt
@@ -0,0 +1,83 @@
+---input---
+import "transforms/yellow.jslt" as yellow
+
+// Known valid types
+let valid-types = [ "SomeType" ]
+
+def foobar(arg) $arg.foobar
+
+{
+ "foobar": foobar(.),
+ "is-valid": contains(.type, $valid-types),
+ *: .
+}
+
+---tokens---
+'import' Keyword.Namespace
+' ' Text.Whitespace
+'"transforms/yellow.jslt"' Literal.String.Symbol
+' ' Text.Whitespace
+'as' Keyword.Namespace
+' ' Text.Whitespace
+'yellow' Name.Namespace
+'\n\n' Text.Whitespace
+
+'// Known valid types\n' Comment.Single
+
+'let' Keyword.Declaration
+' ' Text.Whitespace
+'valid-types' Name.Variable
+' ' Text.Whitespace
+'=' Operator
+' ' Text.Whitespace
+'[' Punctuation
+' ' Text.Whitespace
+'"SomeType"' Literal.String.Double
+' ' Text.Whitespace
+']' Punctuation
+'\n\n' Text.Whitespace
+
+'def' Keyword.Declaration
+' ' Text.Whitespace
+'foobar' Name.Function
+'(' Punctuation
+'arg' Name.Variable
+')' Punctuation
+' ' Text.Whitespace
+'$arg' Name.Variable
+'.' Operator
+'foobar' Name
+'\n\n' Text.Whitespace
+
+'{' Punctuation
+'\n ' Text.Whitespace
+'"foobar"' Literal.String.Double
+':' Punctuation
+' ' Text.Whitespace
+'foobar' Name
+'(' Punctuation
+'.' Operator
+')' Punctuation
+',' Punctuation
+'\n ' Text.Whitespace
+'"is-valid"' Literal.String.Double
+':' Punctuation
+' ' Text.Whitespace
+'contains' Name.Builtin
+'(' Punctuation
+'.' Operator
+'type' Name
+',' Punctuation
+' ' Text.Whitespace
+'$valid-types' Name.Variable
+')' Punctuation
+',' Punctuation
+'\n ' Text.Whitespace
+'*' Operator
+':' Punctuation
+' ' Text.Whitespace
+'.' Operator
+'\n' Text.Whitespace
+
+'}' Punctuation
+'\n' Text.Whitespace
diff --git a/tests/snippets/json/test_basic.txt b/tests/snippets/json/test_basic.txt
new file mode 100644
index 0000000..f93b91b
--- /dev/null
+++ b/tests/snippets/json/test_basic.txt
@@ -0,0 +1,30 @@
+---input---
+{"foo": "bar", "foo2": [1, 2, 3], "\u0123": "\u0123"}
+
+---tokens---
+'{' Punctuation
+'"foo"' Name.Tag
+':' Punctuation
+' ' Text.Whitespace
+'"bar"' Literal.String.Double
+',' Punctuation
+' ' Text.Whitespace
+'"foo2"' Name.Tag
+':' Punctuation
+' ' Text.Whitespace
+'[' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+' ' Text.Whitespace
+'2' Literal.Number.Integer
+',' Punctuation
+' ' Text.Whitespace
+'3' Literal.Number.Integer
+'],' Punctuation
+' ' Text.Whitespace
+'"\\u0123"' Name.Tag
+':' Punctuation
+' ' Text.Whitespace
+'"\\u0123"' Literal.String.Double
+'}' Punctuation
+'\n' Text.Whitespace
diff --git a/tests/snippets/json/test_basic_bare.txt b/tests/snippets/json/test_basic_bare.txt
new file mode 100644
index 0000000..785d264
--- /dev/null
+++ b/tests/snippets/json/test_basic_bare.txt
@@ -0,0 +1,23 @@
+---input---
+"foo": "bar", "foo2": [1, 2, 3]
+
+---tokens---
+'"foo"' Name.Tag
+':' Punctuation
+' ' Text.Whitespace
+'"bar"' Literal.String.Double
+',' Punctuation
+' ' Text.Whitespace
+'"foo2"' Name.Tag
+':' Punctuation
+' ' Text.Whitespace
+'[' Punctuation
+'1' Literal.Number.Integer
+',' Punctuation
+' ' Text.Whitespace
+'2' Literal.Number.Integer
+',' Punctuation
+' ' Text.Whitespace
+'3' Literal.Number.Integer
+']' Punctuation
+'\n' Text.Whitespace