mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
[site] Commenter test
This commit is contained in:
parent
d55ba65405
commit
6e8bc812d3
@ -72,7 +72,7 @@
|
|||||||
* [Rename Test](rename_test.html)
|
* [Rename Test](rename_test.html)
|
||||||
* [Folding Test](folding_test.html)
|
* [Folding Test](folding_test.html)
|
||||||
* [Find Usages Test](find_usages_test.html)
|
* [Find Usages Test](find_usages_test.html)
|
||||||
* [Commenter Test](TODO)
|
* [Commenter Test](commenter_test.html)
|
||||||
* [Reference Test](TODO)
|
* [Reference Test](TODO)
|
||||||
* [Plugin Development FAQ](faq.html)
|
* [Plugin Development FAQ](faq.html)
|
||||||
|
|
||||||
|
38
commenter_test.md
Normal file
38
commenter_test.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
title: Commenter Test
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
INITIAL_SOURCE https://confluence.jetbrains.com/display/IntelliJIDEA/Commenter+Test
|
||||||
|
-->
|
||||||
|
|
||||||
|
# {{ page.title }}
|
||||||
|
|
||||||
|
In this test we will check if the commenter, implemented in the
|
||||||
|
[Commenter](commenter.html)
|
||||||
|
section of the
|
||||||
|
[Custom Language Support Tutorial](cls_tutorial.html),
|
||||||
|
works as we expect.
|
||||||
|
|
||||||
|
### 1. Define a test method
|
||||||
|
|
||||||
|
```java
|
||||||
|
public void testCommenter() {
|
||||||
|
myFixture.configureByText(SimpleFileType.INSTANCE, "<caret>website = http://en.wikipedia.org/");
|
||||||
|
CommentByLineCommentAction commentAction = new CommentByLineCommentAction();
|
||||||
|
commentAction.actionPerformedImpl(getProject(), myFixture.getEditor());
|
||||||
|
myFixture.checkResult("#website = http://en.wikipedia.org/");
|
||||||
|
commentAction.actionPerformedImpl(getProject(), myFixture.getEditor());
|
||||||
|
myFixture.checkResult("website = http://en.wikipedia.org/");
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Run the test
|
||||||
|
|
||||||
|
Run the test and make sure it's green.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
[Previous](find_usages_test.html) [Top](writing_tests_for_plugins.html) [Next](reference_test.html)
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ and cover its code with functional tests.
|
|||||||
* [Rename Test](rename_test.html)
|
* [Rename Test](rename_test.html)
|
||||||
* [Folding Test](folding_test.html)
|
* [Folding Test](folding_test.html)
|
||||||
* [Find Usages Test](find_usages_test.html)
|
* [Find Usages Test](find_usages_test.html)
|
||||||
* [Commenter Test](TODO)
|
* [Commenter Test](commenter_test.html)
|
||||||
* [Reference Test](TODO)
|
* [Reference Test](TODO)
|
||||||
|
|
||||||
The final code can be found on [GitHub](http://github.com/cheptsov/SimplePlugin).
|
The final code can be found on [GitHub](http://github.com/cheptsov/SimplePlugin).
|
Loading…
x
Reference in New Issue
Block a user