[java-highlighting] Test extra semicolons highlighting in JDK 21

IJ-CR-110702

GitOrigin-RevId: c477953def6dd7c26f0b46755afabe98161e08dc
This commit is contained in:
Louis Vignier
2023-08-11 14:51:54 +00:00
committed by intellij-monorepo-bot
parent 89cfc1c9fc
commit e668728d78
5 changed files with 48 additions and 0 deletions
@@ -0,0 +1,6 @@
package foo;
import java.util.List;
;
class Foo {}
@@ -0,0 +1,6 @@
package foo;
<error descr="Extra semicolons between import statements are not allowed">;</error>
import java.util.List;
class Foo {}
@@ -0,0 +1,7 @@
package foo;
import java.util.List;
<error descr="Extra semicolons between import statements are not allowed">;</error>
import java.util.Date;
class Foo {}
@@ -0,0 +1,5 @@
package foo;
;
class Foo {}
@@ -0,0 +1,24 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.java.codeInsight.daemon
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase
import com.intellij.pom.java.LanguageLevel
class SemicolonHighlightingTest: LightDaemonAnalyzerTestCase() {
private val BASE_PATH = "/codeInsight/daemonCodeAnalyzer/semicolonHighlighting"
@Throws(Exception::class)
override fun setUp() {
super.setUp()
setLanguageLevel(LanguageLevel.JDK_21)
}
private fun doTest() {
doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false)
}
fun testSemicolonAfterImport() { doTest() }
fun testSemicolonBeforeImport() { doTest() }
fun testSemicolonBetweenImport() { doTest() }
fun testSemicolonWithoutImport() { doTest() }
}