void () { doTest("<idea-plugin><name>Remote${ Interpreter</name></idea-plugin>"); } public void testUnfinishedStringInDoctype() { doTest("<!DOCTYPE faces-config PUBLIC \"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config1.0//EN"); } public void testUnfinishedMarkupDeclarationInDoctype() { doTest("<!DOCTYPE schema [ <!ENTITY RelativeURL \"[^:#/\\?]*(:{0,0}|[#/\\?].*)\">"); } public void testPerformance1() throws IOException { doTestPerformance("pallada.xml", 200); } public void testPerformance2() throws IOException { doTestPerformance("performance2.xml", 400); } private static void doTestPerformance(String fileName, int expectedMs) throws IOException { final String text = ParsingTestCase.loadFileDefault( PlatformTestUtil.getCommunityPath().replace(File.separatorChar, '/') + "/xml/tests/testData/psi/xml", fileName); final XmlLexer lexer = new XmlLexer(); final FilterLexer filterLexer = new FilterLexer(new XmlLexer(), new FilterLexer.SetFilter(new XMLParserDefinition().getWhitespaceTokens())); PlatformTestUtil.startPerformanceTest("XML Lexer Performance on " + fileName, expectedMs, () -> { for (int i = 0; i < 10; i++) { doLex(lexer, text); doLex(filterLexer, text); } }).assertTiming(); } private static void doLex(Lexer lexer, final String text) { lexer.start(text); long time = System.nanoTime(); int count = 0; while (lexer.getTokenType() != null) { lexer.advance(); count++; } LOG.debug("Plain lexing took " + (System.nanoTime() - time) + "ns. Lexemes count:" + count); } }