testing_highlighting.md: Add a tip for generating test data

This commit is contained in:
Karol Lewandowski 2024-11-28 16:02:23 +01:00
parent 02243ec6c7
commit 50347f566a
2 changed files with 11 additions and 0 deletions

View File

@ -98,3 +98,12 @@ The tag can also have the following optional attributes.
```xml ```xml
<warning>warning_highlight<info>warning-and_info_highlight</warning>info_highlight</info> <warning>warning_highlight<info>warning-and_info_highlight</warning>info_highlight</info>
``` ```
### Generating Test Data
To generate an expected highlighting result file for a test:
1. Make sure that Plugin DevKit plugin is installed and [internal mode is enabled](enabling_internal.md).
2. [Create a Scratch file](https://www.jetbrains.com/help/idea/scratches.html#create-scratch-file) for the tested language.
3. Write code causing tested highlighting.
4. Invoke the <ui-path>Tools | Internal Actions | DevKit | Toggle Expected Highlighting Markup</ui-path> action.

View File

@ -29,6 +29,8 @@ public class Test {
} }
``` ```
> See how to [generate highlighting test data](testing_highlighting.md#generating-test-data).
## Define a Test Method ## Define a Test Method
Add the `testAnnotator()` method to the `SimpleCodeInsightTest` class [previously defined](completion_test.md#define-a-test). Add the `testAnnotator()` method to the `SimpleCodeInsightTest` class [previously defined](completion_test.md#define-a-test).
Again, this method configures the test fixture by using the test files. Again, this method configures the test fixture by using the test files.