mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make CustomFileTypeLexerTest compiled statically
This commit is contained in:
+4
-3
@@ -24,6 +24,7 @@ import com.intellij.testFramework.LexerTestCase
|
||||
import com.intellij.testFramework.PlatformTestUtil
|
||||
import com.intellij.util.Processor
|
||||
import com.intellij.util.ThrowableRunnable
|
||||
import groovy.transform.CompileStatic
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import org.jetbrains.annotations.NotNull
|
||||
@@ -31,6 +32,7 @@ import org.jetbrains.annotations.Nullable
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
@CompileStatic
|
||||
class CustomFileTypeLexerTest extends TestCase {
|
||||
|
||||
private static void doTest(SyntaxTable table, @NonNls String text, @Nullable String expected) {
|
||||
@@ -464,7 +466,7 @@ NUMBER ('0yabc0')
|
||||
int count = 3000
|
||||
List<String> keywords = []
|
||||
for (i in 0..<count) {
|
||||
char start = ('a' as char) + (i % 7)
|
||||
char start = (('a' as char) + (i % 7)).intValue()
|
||||
keywords.add((start as String) * i)
|
||||
}
|
||||
SyntaxTable table = new SyntaxTable()
|
||||
@@ -482,10 +484,9 @@ NUMBER ('0yabc0')
|
||||
|
||||
CharSequence bombed = new SlowCharSequence(text)
|
||||
ThrowableRunnable cl = { LexerTestCase.printTokens(bombed, 0, new CustomFileTypeLexer(table)) } as ThrowableRunnable
|
||||
PlatformTestUtil.startPerformanceTest(getTestName(false), 10000, cl).useLegacyScaling().assertTiming()
|
||||
PlatformTestUtil.startPerformanceTest(name, 10000, cl).assertTiming()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class SlowCharSequence extends StringUtil.BombedCharSequence {
|
||||
|
||||
Reference in New Issue
Block a user