mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
testing_faq.md: format
This commit is contained in:
parent
55ed25bde5
commit
eca31f6ae3
@ -19,10 +19,13 @@ This page lists a number of common questions/issues and techniques useful for te
|
|||||||
|
|
||||||
### How to avoid blinking tests?
|
### How to avoid blinking tests?
|
||||||
|
|
||||||
- Always call `super.tearDown()` inside `finally {..}` block of your test class to avoid leaks and side-effects from previously run (failed) tests.
|
Always call `super.tearDown()` inside `finally {..}` block of your test class to avoid leaks and side-effects from previously run (failed) tests.
|
||||||
- Avoid OS-specific assumptions (e.g., filesystem case-sensitivity, hardcoded separator instead of `java.io.File.separator`).
|
|
||||||
- Use _ordered_ collections or [`UsefulTestCase.assertUnorderedCollection()`](upsource:///platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java).
|
Avoid OS-specific assumptions (e.g., filesystem case-sensitivity, hardcoded separator instead of `java.io.File.separator`).
|
||||||
- Code deferring execution (e.g., via `Application.invokeLater()`) might not run during test execution (and possibly fails in production, too). Use `invokeLater(runnable, myProject.getDisposed()`.
|
|
||||||
|
Use _ordered_ collections or [`UsefulTestCase.assertUnorderedCollection()`](upsource:///platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java).
|
||||||
|
|
||||||
|
Code deferring execution (e.g., via `Application.invokeLater()`) might not run during test execution (and possibly fails in production, too). Use `invokeLater(runnable, myProject.getDisposed()`.
|
||||||
|
|
||||||
### How to avoid test failure when using resources?
|
### How to avoid test failure when using resources?
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user