custom language testing tutorial: link relevant parts via microformat

This commit is contained in:
Yann Cébron 2022-09-08 13:16:33 +02:00
parent b9f2b46f56
commit f0fc6fbac9
11 changed files with 65 additions and 23 deletions

View File

@ -2,9 +2,13 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
<microformat>
This test checks if the Simple Language annotator functionality, implemented in the [Annotator](annotator.md) section of the Custom Language Support Tutorial, works as expected.
**Tested Functionality**: [](annotator.md)
</microformat>
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
## Define Input Test Data
The <path>DefaultTestData.simple</path> file is reused for this test.

View File

@ -2,9 +2,13 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
<microformat>
This test will check if the commenter, implemented in the [Commenter](commenter.md) section of the Custom Language Support Tutorial, works as expected.
**Tested Functionality**: [](commenter.md)
</microformat>
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
## Define a Test Method
Add the `testCommenter()` method to the `SimpleCodeInsightTest` class [previously defined](completion_test.md#define-a-test).

View File

@ -2,9 +2,13 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
<microformat>
This test checks if the Simple Language code completion functionality, implemented in the [Reference Contributor](reference_contributor.md) section of the Custom Language Support Tutorial, works as expected.
**Tested Functionality**: [](reference_contributor.md)
</microformat>
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
## Define Test Data
Create the <path>DefaultTestData.simple</path> file in the <path>testData</path> directory.

View File

@ -2,9 +2,13 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
<microformat>
This test will check if the documentation provider, implemented in the [Documentation](documentation_provider.md) section of the Custom Language Support Tutorial, works as expected.
**Tested Functionality**: [](documentation_provider.md)
</microformat>
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
## Define a Test Method
Add the `testDocumentation()` method to the `SimpleCodeInsightTest` class [previously defined](completion_test.md#define-a-test).

View File

@ -2,9 +2,13 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
<microformat>
This test ensures the find usages provider, implemented in the [Find Usages Provider](find_usages_provider.md) section of the Custom Language Support Tutorial, works correctly.
**Tested Functionality**: [](find_usages_provider.md)
</microformat>
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
## Define the Test Data
Create the <path>FindUsagesTestData.simple</path> file in the <path>testData</path> directory.

View File

@ -2,12 +2,16 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<microformat>
**Tested Functionality**: [](folding_builder.md)
</microformat>
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
This test verifies the Simple Language folding builder, implemented in the [Folding Builder](folding_builder.md) section of the Custom Language Support Tutorial, works as expected.
> A folding builder must implement [`DumbAware`](%gh-ic%/platform/core-api/src/com/intellij/openapi/project/DumbAware.java) to pass tests.
> See [Define a Folding Builder](folding_builder.md#define-a-folding-builder) for more information.
> See [](folding_builder.md#define-a-folding-builder) for more information.
>
{type="note"}

View File

@ -2,11 +2,15 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<microformat>
**Tested Functionality**: [](formatter.md)
</microformat>
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
This test checks if the Simple Language formatter, implemented in the [Formatter](formatter.md) section of the Custom Language Support Tutorial, works as expected.
> See also [`FormatterTestCase`](%gh-ic%/platform/testFramework/src/com/intellij/psi/formatter/FormatterTestCase.java) as convenient base class.
See also [`FormatterTestCase`](%gh-ic%/platform/testFramework/src/com/intellij/psi/formatter/FormatterTestCase.java) as convenient base class.
## Define Test Data
Create the <path>FormatterTestData.simple</path> file in the <path>testData</path> directory.

View File

@ -2,9 +2,13 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
<microformat>
The first test checks if the Simple Language parser, implemented in the [Lexer and Parser Definition](lexer_and_parser_definition.md) section of the Custom Language Support Tutorial, works as expected.
**Tested Functionality**: [](lexer_and_parser_definition.md)
</microformat>
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
For more complex Lexers (e.g., having additional logic), it is advisable to add separate tests inheriting from [`LexerTestCase`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/LexerTestCase.java).

View File

@ -2,9 +2,13 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
<microformat>
This test checks if references functionality, implemented in the [Reference Contributor](reference_contributor.md) section of the Custom Language Support Tutorial, works as expected.
**Tested Functionality**: [](reference_contributor.md)
</microformat>
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
## Define Test Data
This test reuses the Simple Language file <path>DefaultTestData.simple</path>.

View File

@ -2,9 +2,13 @@
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
<microformat>
This test verifies the Simple Language in-place rename functionality, implemented in the [Reference Contributor](reference_contributor.md) section of the Custom Language Support Tutorial, works as expected.
**Tested Functionality**: [](reference_contributor.md)
</microformat>
<include src="tests_prerequisites.md" include-id="custom_language_testing_tutorial_header"></include>
## Define Input Test Data
Create the <path>RenameTestData.simple</path> properties file in the <path>testData</path> directory.

View File

@ -10,7 +10,9 @@ This tutorial demonstrates how to write and run automated tests for a custom lan
As an example, the plugin implemented in the [Custom Language Support Tutorial](custom_language_support_tutorial.md) is used to demonstrate functional test development.
The plugin and test code can be found in the [simple_language_plugin](%gh-sdk-samples%/simple_language_plugin) code sample.
> Corresponding parts are linked under **Tested Functionality** on top of each page in this tutorial.
>
{type="tip"}
* [](tests_prerequisites.md)
* [](parsing_test.md)