mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 17:27:49 +08:00
1.3 KiB
1.3 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.