2020-02-19 22:25:03 -08:00

1.4 KiB

title
7. Folding Test

This test verifies the Simple Language folding builder, implemented in the Folding Builder section of the Custom Language Support Tutorial, works as expected.

Note

A folding builder must implement DumbAware to pass tests. See Define a Folding Builder for more information.

7.1. Define Test Data

Create a file FoldingTestData.java in the testData directory. This java file contains markup instructions for three different cases of code folding.

{% include /code_samples/simple_language_plugin/src/test/testData/FoldingTestData.java %}

7.2. Define a Test

Add the testFolding() method to the SimpleCodeInsightTest class previously defined. This test method reuses the DefaultTestData.simple properties file.

  public void testFolding() {
    myFixture.configureByFile("DefaultTestData.simple");
    myFixture.testFolding(getTestDataPath() + "/FoldingTestData.java");
  }

7.3. Run the Test

Run the test and make sure it's green.