mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 15:06:56 +07:00
[unit perf tests] AT-644 Removed expected time from the tests
GitOrigin-RevId: a53f40c1721a46c7833018346dc622dec1f1b80a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1d5c04b55f
commit
b143fe1540
@@ -12,7 +12,7 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() {
|
||||
val manager = SpellCheckerManager.getInstance(project)
|
||||
val total = Datasets.missp.flatMap { it.misspellings + it.word }.size
|
||||
|
||||
PlatformTestUtil.startPerformanceTest("highlight ${total} words in missp", 1750) {
|
||||
PlatformTestUtil.startPerformanceTest("highlight ${total} words in missp") {
|
||||
for (word in Datasets.missp) {
|
||||
manager.hasProblem(word.word)
|
||||
for (missp in word.misspellings) {
|
||||
@@ -26,7 +26,7 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() {
|
||||
val manager = SpellCheckerManager.getInstance(project)
|
||||
val total = Datasets.words.flatMap { it.misspellings + it.word }.size
|
||||
|
||||
PlatformTestUtil.startPerformanceTest("highlight ${total} words in words", 200) {
|
||||
PlatformTestUtil.startPerformanceTest("highlight ${total} words in words") {
|
||||
for (word in Datasets.words) {
|
||||
manager.hasProblem(word.word)
|
||||
for (missp in word.misspellings) {
|
||||
@@ -41,7 +41,7 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() {
|
||||
val manager = SpellCheckerManager.getInstance(project)
|
||||
val total = Datasets.wordsCamelCase.flatMap { it.misspellings + it.word }.size
|
||||
|
||||
PlatformTestUtil.startPerformanceTest("highlight ${total} words in camel-case", 500) {
|
||||
PlatformTestUtil.startPerformanceTest("highlight ${total} words in camel-case") {
|
||||
for (word in Datasets.wordsCamelCase) {
|
||||
manager.hasProblem(word.word)
|
||||
for (missp in word.misspellings) {
|
||||
|
||||
@@ -57,7 +57,7 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase
|
||||
|
||||
DaemonCodeAnalyzer.getInstance(getProject()).restart();
|
||||
int[] toIgnore = ignoreEverythingExceptInspections();
|
||||
PlatformTestUtil.startPerformanceTest("many typos highlighting", 12_000, () -> {
|
||||
PlatformTestUtil.startPerformanceTest("many typos highlighting", () -> {
|
||||
assertSize(typoCount, CodeInsightTestFixtureImpl.instantiateAndRun(myFixture.getFile(), myFixture.getEditor(), toIgnore, false));
|
||||
}).assertTiming();
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase
|
||||
assertEmpty(infos);
|
||||
LOG.debug("warm-up took " + (System.currentTimeMillis() - start) + " ms");
|
||||
|
||||
PlatformTestUtil.startPerformanceTest("many whitespaces highlighting", 4500, () -> {
|
||||
PlatformTestUtil.startPerformanceTest("many whitespaces highlighting", () -> {
|
||||
DaemonCodeAnalyzer.getInstance(getProject()).restart();
|
||||
assertEmpty(runLocalInspections());
|
||||
}).assertTiming();
|
||||
@@ -87,43 +87,43 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase
|
||||
|
||||
public void testVeryLongEmail() {
|
||||
final String text = "\\LONG_EMAIL: " + StringUtil.repeat("ivan.ivanov", 1000000) + "@mail.com\n";
|
||||
doSplitterPerformanceTest(text, CommentSplitter.getInstance(), 8000);
|
||||
doSplitterPerformanceTest(text, CommentSplitter.getInstance());
|
||||
}
|
||||
|
||||
public void testVeryLongURL() {
|
||||
final String text = "\\LONG_URL: http://" + StringUtil.repeat("ivan.ivanov", 1000000) + ".com\n";
|
||||
doSplitterPerformanceTest(text, CommentSplitter.getInstance(), 8000);
|
||||
doSplitterPerformanceTest(text, CommentSplitter.getInstance());
|
||||
}
|
||||
|
||||
public void testVeryLongHTML() {
|
||||
final String text = "\\ LONG_HTML <!--<li>something go here</li>"
|
||||
+ StringUtil.repeat("<li>next content</li>", 1000000)
|
||||
+ "foooo barrrr <p> text -->";
|
||||
doSplitterPerformanceTest(text, CommentSplitter.getInstance(), 5000);
|
||||
doSplitterPerformanceTest(text, CommentSplitter.getInstance());
|
||||
}
|
||||
|
||||
public void testVeryLongIdentifier() {
|
||||
final String text = StringUtil.repeat("identifier1", 1000000);
|
||||
doSplitterPerformanceTest(text, IdentifierSplitter.getInstance(), 3000);
|
||||
doSplitterPerformanceTest(text, IdentifierSplitter.getInstance());
|
||||
}
|
||||
|
||||
public void testVeryLongSpecialCharacters() {
|
||||
final String text = "word" + StringUtil.repeat("\n\t\r\t\n", 1000000);
|
||||
doSplitterPerformanceTest(text, TextSplitter.getInstance(), 2000);
|
||||
doSplitterPerformanceTest(text, TextSplitter.getInstance());
|
||||
}
|
||||
|
||||
public void testVeryLongProperty() {
|
||||
final String text = StringUtil.repeat("properties.test.properties", 1000000);
|
||||
doSplitterPerformanceTest(text, PropertiesSplitter.getInstance(), 4000);
|
||||
doSplitterPerformanceTest(text, PropertiesSplitter.getInstance());
|
||||
}
|
||||
|
||||
public void testVeryLongList() {
|
||||
final String text = StringUtil.repeat("properties,test,properties", 1000000);
|
||||
doSplitterPerformanceTest(text, PlainTextSplitter.getInstance(), 3000);
|
||||
doSplitterPerformanceTest(text, PlainTextSplitter.getInstance());
|
||||
}
|
||||
|
||||
private static void doSplitterPerformanceTest(String text, Splitter splitter, int expectedTime) {
|
||||
PlatformTestUtil.startPerformanceTest("long word for spelling", expectedTime, () -> {
|
||||
private static void doSplitterPerformanceTest(String text, Splitter splitter) {
|
||||
PlatformTestUtil.startPerformanceTest("long word for spelling", () -> {
|
||||
try {
|
||||
splitter.split(text, TextRange.allOf(text), (textRange) -> {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user