Skip to content

Commit

Permalink
testing_highlighting.md: Add a tip for generating test data
Browse files Browse the repository at this point in the history
  • Loading branch information
karollewandowski committed Nov 28, 2024
1 parent 02243ec commit 50347f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions topics/basics/testing_plugins/testing_highlighting.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,12 @@ The tag can also have the following optional attributes.
```xml
<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.
2 changes: 2 additions & 0 deletions topics/tutorials/writing_tests_for_plugins/annotator_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class Test {
}
```

> See how to [generate highlighting test data](testing_highlighting.md#generating-test-data).
## Define a Test Method
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.
Expand Down

0 comments on commit 50347f5

Please sign in to comment.