@@ -36,6 +36,8 @@ class SyntaxHighlightingTests extends DottyTest {
36
36
37
37
@ Test
38
38
def types = {
39
+ test(" type Foo" , " <K|type> <T|Foo>" )
40
+ test(" type Foo =" , " <K|type> <T|Foo> =" )
39
41
test(" type Foo = Int" , " <K|type> <T|Foo> = <T|Int>" )
40
42
test(" type A = String | Int" , " <K|type> <T|A> = <T|String | Int>" )
41
43
test(" type B = String & Int" , " <K|type> <T|B> = <T|String & Int>" )
@@ -74,15 +76,35 @@ class SyntaxHighlightingTests extends DottyTest {
74
76
@ Test
75
77
def expressions = {
76
78
test(" if (true) 1 else 2" , " <K|if> (<L|true>) <L|1> <K|else> <L|2>" )
77
- test(" val x = 1 + 2 + 3" , " <K|val> <V|x> = <L|1> + <L|2> + <L|3>" )
78
- test(" if (true) 3 else 1" , " <K|if> (<K|true>) <L|3> <K|else> <L|1>" )
79
+ test(" 1 + 2 + 3" , " <L|1> + <L|2> + <L|3>" )
79
80
}
80
81
81
82
@ Test
82
83
def valOrDefDef = {
83
- test(" val a = 123" , " <K|val> <V|a> = <L|123>" )
84
- test(" var e: Int = 123" , " <K|var> <V|e>: <T|Int> = <L|123>" )
85
- test(" def f = 123" , " <K|def> <V|f> = <L|123>" )
84
+ test(" val" , " <K|val>" )
85
+ test(" val foo" , " <K|val> <V|foo>" )
86
+ test(" val foo =" , " <K|val> <V|foo> =" )
87
+ test(" val foo = 123" , " <K|val> <V|foo> = <L|123>" )
88
+
89
+ test(" var" , " <K|var>" )
90
+ test(" var foo" , " <K|var> <V|foo>" )
91
+ test(" var foo:" , " <K|var> <V|foo>:" )
92
+ test(" var foo: Int" , " <K|var> <V|foo>: <T|int>" )
93
+ test(" var foo: Int =" , " <K|var> <V|foo>: <T|int> =" )
94
+ test(" var foo: Int = 123" , " <K|var> <V|foo>: <T|int> = <L|123>" )
95
+
96
+ test(" def" , " <K|def>" )
97
+ test(" def foo" , " <K|def> <V|foo>" )
98
+ test(" def foo(" , " <K|def> <V|foo>(" )
99
+ test(" def foo(bar" , " <K|def> <V|foo>(<V|bar>" )
100
+ test(" def foo(bar:" , " <K|def> <V|foo>(<V|bar>:" )
101
+ test(" def foo(bar: Int" , " <K|def> <V|foo>(<V|bar>: <T|Int>" )
102
+ test(" def foo(bar: Int)" , " <K|def> <V|foo>(<V|bar>: <T|Int>)" )
103
+ test(" def foo(bar: Int):" , " <K|def> <V|foo>(<V|bar>: <T|Int>):" )
104
+ test(" def foo(bar: Int): Int" , " <K|def> <V|foo>(<V|bar>: <T|Int>): <T|Int>" )
105
+ test(" def foo(bar: Int): Int =" , " <K|def> <V|foo>(<V|bar>: <T|Int>): <T|Int> =" )
106
+ test(" def foo(bar: Int): Int = 123" , " <K|def> <V|foo>(<V|bar>: <T|Int>): <T|Int> = <L|123>" )
107
+
86
108
test(" def f1(x: Int) = 123" , " <K|def> <V|f1>(<V|x>: <T|Int>) = <L|123>" )
87
109
test(" def f2[T](x: T) = { 123 }" , " <K|def> <V|f2>[<T|T>](<V|x>: <T|T>) = { <L|123> }" )
88
110
}
0 commit comments