make CustomFileTypeLexerTest compiled statically

This commit is contained in:
peter
2017-06-07 16:29:08 +02:00
parent 87c0637b3e
commit b9b4498af6
@@ -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 {