mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-19 06:33:06 -03:00
Reorganize tests into a real spec suite
This commit is contained in:
33
spec/tests/scala/test_colon_colon_function_name.txt
Normal file
33
spec/tests/scala/test_colon_colon_function_name.txt
Normal file
@ -0,0 +1,33 @@
|
||||
---input---
|
||||
def ::(xs: List[T]): List[T] = ::(x, xs)
|
||||
|
||||
---tokens---
|
||||
'def' Keyword
|
||||
' ' Text.Whitespace
|
||||
'::' Name.Function
|
||||
'(' Punctuation
|
||||
'xs' Name
|
||||
':' Punctuation
|
||||
' ' Text.Whitespace
|
||||
'List' Name.Class
|
||||
'[' Punctuation
|
||||
'T' Name.Class
|
||||
']' Punctuation
|
||||
')' Punctuation
|
||||
':' Punctuation
|
||||
' ' Text.Whitespace
|
||||
'List' Name.Class
|
||||
'[' Punctuation
|
||||
'T' Name.Class
|
||||
']' Punctuation
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'::' Name
|
||||
'(' Punctuation
|
||||
'x' Name
|
||||
',' Punctuation
|
||||
' ' Text.Whitespace
|
||||
'xs' Name
|
||||
')' Punctuation
|
||||
'\n' Text.Whitespace
|
37
spec/tests/scala/test_default_parameter.txt
Normal file
37
spec/tests/scala/test_default_parameter.txt
Normal file
@ -0,0 +1,37 @@
|
||||
---input---
|
||||
def f(using y: Char = if true then 'a' else 2): Int = ???
|
||||
|
||||
---tokens---
|
||||
'def' Keyword
|
||||
' ' Text.Whitespace
|
||||
'f' Name.Function
|
||||
'(' Punctuation
|
||||
'using' Keyword
|
||||
' ' Text.Whitespace
|
||||
'y' Name
|
||||
':' Punctuation
|
||||
' ' Text.Whitespace
|
||||
'Char' Name.Class
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'if' Keyword
|
||||
' ' Text.Whitespace
|
||||
'true' Keyword.Constant
|
||||
' ' Text.Whitespace
|
||||
'then' Keyword
|
||||
' ' Text.Whitespace
|
||||
"'a'" Literal.String.Char
|
||||
' ' Text.Whitespace
|
||||
'else' Keyword
|
||||
' ' Text.Whitespace
|
||||
'2' Literal.Number.Integer
|
||||
')' Punctuation
|
||||
':' Punctuation
|
||||
' ' Text.Whitespace
|
||||
'Int' Name.Class
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'???' Operator
|
||||
'\n' Text.Whitespace
|
8
spec/tests/scala/test_end_val.txt
Normal file
8
spec/tests/scala/test_end_val.txt
Normal file
@ -0,0 +1,8 @@
|
||||
---input---
|
||||
end val
|
||||
|
||||
---tokens---
|
||||
'end' Keyword
|
||||
' ' Text.Whitespace
|
||||
'val' Keyword
|
||||
'\n' Text.Whitespace
|
8
spec/tests/scala/test_end_valx.txt
Normal file
8
spec/tests/scala/test_end_valx.txt
Normal file
@ -0,0 +1,8 @@
|
||||
---input---
|
||||
end valx
|
||||
|
||||
---tokens---
|
||||
'end' Keyword
|
||||
' ' Text.Whitespace
|
||||
'valx' Name.Namespace
|
||||
'\n' Text.Whitespace
|
12
spec/tests/scala/test_float_with_exponents.txt
Normal file
12
spec/tests/scala/test_float_with_exponents.txt
Normal file
@ -0,0 +1,12 @@
|
||||
---input---
|
||||
.1e12 .1e+34 .1e-56 .1e12f
|
||||
|
||||
---tokens---
|
||||
'.1e12' Literal.Number.Float
|
||||
' ' Text.Whitespace
|
||||
'.1e+34' Literal.Number.Float
|
||||
' ' Text.Whitespace
|
||||
'.1e-56' Literal.Number.Float
|
||||
' ' Text.Whitespace
|
||||
'.1e12f' Literal.Number.Float
|
||||
'\n' Text.Whitespace
|
18
spec/tests/scala/test_function_operator_name.txt
Normal file
18
spec/tests/scala/test_function_operator_name.txt
Normal file
@ -0,0 +1,18 @@
|
||||
---input---
|
||||
def < (y: String): Boolean
|
||||
|
||||
---tokens---
|
||||
'def' Keyword
|
||||
' ' Text.Whitespace
|
||||
'<' Name.Function
|
||||
' ' Text.Whitespace
|
||||
'(' Punctuation
|
||||
'y' Name
|
||||
':' Punctuation
|
||||
' ' Text.Whitespace
|
||||
'String' Name.Class
|
||||
')' Punctuation
|
||||
':' Punctuation
|
||||
' ' Text.Whitespace
|
||||
'Boolean' Name.Class
|
||||
'\n' Text.Whitespace
|
12
spec/tests/scala/test_import_path.txt
Normal file
12
spec/tests/scala/test_import_path.txt
Normal file
@ -0,0 +1,12 @@
|
||||
---input---
|
||||
import a.b.c
|
||||
|
||||
---tokens---
|
||||
'import' Keyword
|
||||
' ' Text.Whitespace
|
||||
'a' Name.Namespace
|
||||
'.' Punctuation
|
||||
'b' Name.Namespace
|
||||
'.' Punctuation
|
||||
'c' Name
|
||||
'\n' Text.Whitespace
|
@ -0,0 +1,8 @@
|
||||
---input---
|
||||
'1 //'
|
||||
|
||||
---tokens---
|
||||
"'" Error
|
||||
'1' Literal.Number.Integer
|
||||
' ' Text.Whitespace
|
||||
"//'\n" Comment.Single
|
12
spec/tests/scala/test_open_soft_keyword.txt
Normal file
12
spec/tests/scala/test_open_soft_keyword.txt
Normal file
@ -0,0 +1,12 @@
|
||||
---input---
|
||||
val open = true
|
||||
|
||||
---tokens---
|
||||
'val' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'open' Name
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'true' Keyword.Constant
|
||||
'\n' Text.Whitespace
|
11
spec/tests/scala/test_package_name.txt
Normal file
11
spec/tests/scala/test_package_name.txt
Normal file
@ -0,0 +1,11 @@
|
||||
---input---
|
||||
package p1.p2:
|
||||
|
||||
---tokens---
|
||||
'package' Keyword
|
||||
' ' Text.Whitespace
|
||||
'p1' Name.Namespace
|
||||
'.' Punctuation
|
||||
'p2' Name
|
||||
':' Punctuation
|
||||
'\n' Text.Whitespace
|
10
spec/tests/scala/test_prepend_operator.txt
Normal file
10
spec/tests/scala/test_prepend_operator.txt
Normal file
@ -0,0 +1,10 @@
|
||||
---input---
|
||||
a +: b
|
||||
|
||||
---tokens---
|
||||
'a' Name
|
||||
' ' Text.Whitespace
|
||||
'+:' Operator
|
||||
' ' Text.Whitespace
|
||||
'b' Name
|
||||
'\n' Text.Whitespace
|
10
spec/tests/scala/test_qualified_name.txt
Normal file
10
spec/tests/scala/test_qualified_name.txt
Normal file
@ -0,0 +1,10 @@
|
||||
---input---
|
||||
a.b.c
|
||||
|
||||
---tokens---
|
||||
'a' Name
|
||||
'.' Punctuation
|
||||
'b' Name
|
||||
'.' Punctuation
|
||||
'c' Name
|
||||
'\n' Text.Whitespace
|
10
spec/tests/scala/test_qualified_name_class.txt
Normal file
10
spec/tests/scala/test_qualified_name_class.txt
Normal file
@ -0,0 +1,10 @@
|
||||
---input---
|
||||
a.b.C
|
||||
|
||||
---tokens---
|
||||
'a' Name
|
||||
'.' Punctuation
|
||||
'b' Name
|
||||
'.' Punctuation
|
||||
'C' Name.Class
|
||||
'\n' Text.Whitespace
|
6
spec/tests/scala/test_script_header.txt
Normal file
6
spec/tests/scala/test_script_header.txt
Normal file
@ -0,0 +1,6 @@
|
||||
---input---
|
||||
#!/usr/bin/scala
|
||||
|
||||
---tokens---
|
||||
'#!/usr/bin/scala' Comment.Hashbang
|
||||
'\n' Text.Whitespace
|
7
spec/tests/scala/test_symbol_followed_by_op.txt
Normal file
7
spec/tests/scala/test_symbol_followed_by_op.txt
Normal file
@ -0,0 +1,7 @@
|
||||
---input---
|
||||
symbol*
|
||||
|
||||
---tokens---
|
||||
'symbol' Name
|
||||
'*' Operator
|
||||
'\n' Text.Whitespace
|
6
spec/tests/scala/test_symbol_name_ending_with_star.txt
Normal file
6
spec/tests/scala/test_symbol_name_ending_with_star.txt
Normal file
@ -0,0 +1,6 @@
|
||||
---input---
|
||||
symbol_*
|
||||
|
||||
---tokens---
|
||||
'symbol_*' Name
|
||||
'\n' Text.Whitespace
|
12
spec/tests/scala/test_underscore_name.txt
Normal file
12
spec/tests/scala/test_underscore_name.txt
Normal file
@ -0,0 +1,12 @@
|
||||
---input---
|
||||
val head = _head
|
||||
|
||||
---tokens---
|
||||
'val' Keyword.Declaration
|
||||
' ' Text.Whitespace
|
||||
'head' Name
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'_head' Name
|
||||
'\n' Text.Whitespace
|
Reference in New Issue
Block a user