Skip to content

Commit 1081d62

Browse files
committed
add test for syntax highlight end
1 parent d9c666f commit 1081d62

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

compiler/test/dotty/tools/dotc/printing/SyntaxHighlightingTests.scala

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,41 @@ class SyntaxHighlightingTests extends DottyTest {
138138
test("val inline = 2", "<K|val> <V|inline> = <L|2>")
139139
test("def inline = 2", "<K|def> <V|inline> = <L|2>")
140140
test("def foo(inline: Int) = 2", "<K|def> <V|foo>(<V|inline>: <T|Int>) = <L|2>")
141+
test(
142+
"""enum Foo:
143+
| case foo
144+
|end Foo""".stripMargin,
145+
"""<K|enum> <T|Foo>:
146+
| <K|case> <T|foo>
147+
|<K|end> <T|Foo>""".stripMargin
148+
)
149+
test(
150+
"""class Foo:
151+
|end Foo""".stripMargin,
152+
"""<K|class> <T|Foo>:
153+
|<K|end> <T|Foo>""".stripMargin
154+
)
155+
test(
156+
"""object Foo:
157+
|end Foo""".stripMargin,
158+
"""<K|object> <T|Foo>:
159+
|<K|end> <T|Foo>""".stripMargin
160+
)
161+
test(
162+
"""def foo =
163+
| ()
164+
|end foo""".stripMargin,
165+
"""<K|def> <V|foo> =
166+
| ()
167+
|<K|end> <V|foo>""".stripMargin
168+
)
169+
test(
170+
"""val foo =
171+
| ()
172+
|end foo""".stripMargin,
173+
"""<K|val> <V|foo> =
174+
| ()
175+
|<K|end> <V|foo>""".stripMargin
176+
)
141177
}
142178
}

0 commit comments

Comments
 (0)