diff --git a/platform/testFramework/testSrc/tests/testGroups.properties b/platform/testFramework/testSrc/tests/testGroups.properties index c3205225ba09..2cf6040c27e4 100644 --- a/platform/testFramework/testSrc/tests/testGroups.properties +++ b/platform/testFramework/testSrc/tests/testGroups.properties @@ -121,6 +121,7 @@ com.siyeh.* [COMMUNITY_EXPLORATORY_TESTS] com.intellij.java.propertyBased.JavaCodeInsightSanityTest com.intellij.java.propertyBased.JavaPsiIndexConsistencyTest +com.intellij.lang.properties.propertyBased.PropertiesCodeInsightSanityTest [GROOVY_TESTS] org.jetbrains.plugins.groovy.* diff --git a/plugins/properties/testSrc/com/intellij/lang/properties/propertyBased/PropertiesCodeInsightSanityTest.java b/plugins/properties/testSrc/com/intellij/lang/properties/propertyBased/PropertiesCodeInsightSanityTest.java new file mode 100644 index 000000000000..23fd8f5ab1e3 --- /dev/null +++ b/plugins/properties/testSrc/com/intellij/lang/properties/propertyBased/PropertiesCodeInsightSanityTest.java @@ -0,0 +1,35 @@ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.intellij.lang.properties.propertyBased; + +import com.intellij.lang.properties.PropertiesFileType; +import com.intellij.openapi.application.PathManager; +import com.intellij.psi.PsiFile; +import com.intellij.testFramework.SkipSlowTestLocally; +import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase; +import com.intellij.testFramework.propertyBased.CheckHighlighterConsistency; +import com.intellij.testFramework.propertyBased.MadTestingAction; +import com.intellij.testFramework.propertyBased.MadTestingUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.jetCheck.Generator; +import org.jetbrains.jetCheck.PropertyChecker; + +import java.util.function.Function; +import java.util.function.Supplier; + +@SkipSlowTestLocally +public class PropertiesCodeInsightSanityTest extends LightCodeInsightFixtureTestCase { + + public void testIncrementalHighlighterUpdate() { + PropertyChecker.checkScenarios(actionsOnPropertiesFiles(CheckHighlighterConsistency.randomEditsWithHighlighterChecks)); + } + + public void testReparse() { + PropertyChecker.checkScenarios(actionsOnPropertiesFiles(MadTestingUtil::randomEditsWithReparseChecks)); + } + + @NotNull + private Supplier actionsOnPropertiesFiles(Function> fileActions) { + return MadTestingUtil.actionsOnFileContents(myFixture, PathManager.getHomePath(), + f -> f.getName().endsWith(PropertiesFileType.DOT_DEFAULT_EXTENSION), fileActions); + } +}