From f0fc6fbac9366a48ea2bc131016176c94702f8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Thu, 8 Sep 2022 13:16:33 +0200 Subject: [PATCH] custom language testing tutorial: link relevant parts via microformat --- .../writing_tests_for_plugins/annotator_test.md | 8 ++++++-- .../writing_tests_for_plugins/commenter_test.md | 8 ++++++-- .../writing_tests_for_plugins/completion_test.md | 8 ++++++-- .../writing_tests_for_plugins/documentation_test.md | 8 ++++++-- .../writing_tests_for_plugins/find_usages_test.md | 8 ++++++-- .../writing_tests_for_plugins/folding_test.md | 10 +++++++--- .../writing_tests_for_plugins/formatter_test.md | 10 +++++++--- .../writing_tests_for_plugins/parsing_test.md | 8 ++++++-- .../writing_tests_for_plugins/reference_test.md | 8 ++++++-- .../tutorials/writing_tests_for_plugins/rename_test.md | 8 ++++++-- .../writing_tests_for_plugins.md | 4 +++- 11 files changed, 65 insertions(+), 23 deletions(-) diff --git a/topics/tutorials/writing_tests_for_plugins/annotator_test.md b/topics/tutorials/writing_tests_for_plugins/annotator_test.md index 24d0f5472..bbdeac70e 100644 --- a/topics/tutorials/writing_tests_for_plugins/annotator_test.md +++ b/topics/tutorials/writing_tests_for_plugins/annotator_test.md @@ -2,9 +2,13 @@ - + -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) + + + + ## Define Input Test Data The DefaultTestData.simple file is reused for this test. diff --git a/topics/tutorials/writing_tests_for_plugins/commenter_test.md b/topics/tutorials/writing_tests_for_plugins/commenter_test.md index 7eeefff35..0bf5fbf82 100644 --- a/topics/tutorials/writing_tests_for_plugins/commenter_test.md +++ b/topics/tutorials/writing_tests_for_plugins/commenter_test.md @@ -2,9 +2,13 @@ - + -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) + + + + ## Define a Test Method Add the `testCommenter()` method to the `SimpleCodeInsightTest` class [previously defined](completion_test.md#define-a-test). diff --git a/topics/tutorials/writing_tests_for_plugins/completion_test.md b/topics/tutorials/writing_tests_for_plugins/completion_test.md index c1fab3efe..5baabae10 100644 --- a/topics/tutorials/writing_tests_for_plugins/completion_test.md +++ b/topics/tutorials/writing_tests_for_plugins/completion_test.md @@ -2,9 +2,13 @@ - + -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) + + + + ## Define Test Data Create the DefaultTestData.simple file in the testData directory. diff --git a/topics/tutorials/writing_tests_for_plugins/documentation_test.md b/topics/tutorials/writing_tests_for_plugins/documentation_test.md index cef0aecad..4678d69b9 100644 --- a/topics/tutorials/writing_tests_for_plugins/documentation_test.md +++ b/topics/tutorials/writing_tests_for_plugins/documentation_test.md @@ -2,9 +2,13 @@ - + -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) + + + + ## Define a Test Method Add the `testDocumentation()` method to the `SimpleCodeInsightTest` class [previously defined](completion_test.md#define-a-test). diff --git a/topics/tutorials/writing_tests_for_plugins/find_usages_test.md b/topics/tutorials/writing_tests_for_plugins/find_usages_test.md index 374796ed2..2c8ed07ea 100644 --- a/topics/tutorials/writing_tests_for_plugins/find_usages_test.md +++ b/topics/tutorials/writing_tests_for_plugins/find_usages_test.md @@ -2,9 +2,13 @@ - + -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) + + + + ## Define the Test Data Create the FindUsagesTestData.simple file in the testData directory. diff --git a/topics/tutorials/writing_tests_for_plugins/folding_test.md b/topics/tutorials/writing_tests_for_plugins/folding_test.md index 8a32cd33f..1febc1982 100644 --- a/topics/tutorials/writing_tests_for_plugins/folding_test.md +++ b/topics/tutorials/writing_tests_for_plugins/folding_test.md @@ -2,12 +2,16 @@ + + +**Tested Functionality**: [](folding_builder.md) + + + -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"} diff --git a/topics/tutorials/writing_tests_for_plugins/formatter_test.md b/topics/tutorials/writing_tests_for_plugins/formatter_test.md index 842a782b7..a2f62b178 100644 --- a/topics/tutorials/writing_tests_for_plugins/formatter_test.md +++ b/topics/tutorials/writing_tests_for_plugins/formatter_test.md @@ -2,11 +2,15 @@ + + +**Tested Functionality**: [](formatter.md) + + + -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 FormatterTestData.simple file in the testData directory. diff --git a/topics/tutorials/writing_tests_for_plugins/parsing_test.md b/topics/tutorials/writing_tests_for_plugins/parsing_test.md index 314893d99..a005619f2 100644 --- a/topics/tutorials/writing_tests_for_plugins/parsing_test.md +++ b/topics/tutorials/writing_tests_for_plugins/parsing_test.md @@ -2,9 +2,13 @@ - + -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) + + + + 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). diff --git a/topics/tutorials/writing_tests_for_plugins/reference_test.md b/topics/tutorials/writing_tests_for_plugins/reference_test.md index c0b744032..2eccad2f8 100644 --- a/topics/tutorials/writing_tests_for_plugins/reference_test.md +++ b/topics/tutorials/writing_tests_for_plugins/reference_test.md @@ -2,9 +2,13 @@ - + -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) + + + + ## Define Test Data This test reuses the Simple Language file DefaultTestData.simple. diff --git a/topics/tutorials/writing_tests_for_plugins/rename_test.md b/topics/tutorials/writing_tests_for_plugins/rename_test.md index ea7d60d34..e142ea8da 100644 --- a/topics/tutorials/writing_tests_for_plugins/rename_test.md +++ b/topics/tutorials/writing_tests_for_plugins/rename_test.md @@ -2,9 +2,13 @@ - + -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) + + + + ## Define Input Test Data Create the RenameTestData.simple properties file in the testData directory. diff --git a/topics/tutorials/writing_tests_for_plugins/writing_tests_for_plugins.md b/topics/tutorials/writing_tests_for_plugins/writing_tests_for_plugins.md index 9069e0f8e..a227c800c 100644 --- a/topics/tutorials/writing_tests_for_plugins/writing_tests_for_plugins.md +++ b/topics/tutorials/writing_tests_for_plugins/writing_tests_for_plugins.md @@ -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)