[jvm] IDEA-271571 Don't highlight @TestOnly usages in doc

GitOrigin-RevId: e9011bbb9d881333316563cde008af0e4ab0d954
This commit is contained in:
Bart van Helvert
2021-08-03 15:21:58 +02:00
committed by intellij-monorepo-bot
parent d31c36d811
commit 72379c315e
4 changed files with 32 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
package test;
import org.jetbrains.annotations.TestOnly;
import org.jetbrains.annotations.VisibleForTesting;
import java.util.function.Function;
public class TestOnlyDoc {
@TestOnly
TestOnlyDoc() { }
@TestOnly
static String testMethod() { return "Foo"; }
/**
* {@link #TestOnlyTest()}
* {@link #TestOnlyTest#testMethod()}
* {@link #testMethod()}
*/
public static void docced() { }
}

View File

@@ -6,6 +6,10 @@ import com.intellij.jvm.analysis.JvmAnalysisTestsUtil
class JavaTestOnlyInspectionTest : TestOnlyInspectionTestBase() {
override fun getTestDataPath() = JvmAnalysisTestsUtil.TEST_DATA_PROJECT_RELATIVE_BASE_PATH + "/codeInspection/testonly"
fun `test @TestOnly not highlighting in javadoc`() {
myFixture.testHighlighting("TestOnlyDoc.java")
}
fun `test @TestOnly in production code`() {
myFixture.testHighlighting("TestOnlyTest.java")
}