<commit_before>package org.jetbrains.plugins.scala.performance.typing

import java.io.File

import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.CharsetToolkit
import com.intellij.testFramework.PlatformTestUtil
import com.intellij.util.ThrowableRunnable
import org.jetbrains.plugins.scala.base.ScalaFixtureTestCase
import org.jetbrains.plugins.scala.util.TestUtils

/**
  * Author: <NAME>
  * Date: 10/29/15.
  */
abstract class TypingTestWithPerformanceTestBase extends ScalaFixtureTestCase {
  def doTest(stringsToType: List[String], timeoutInMillis: Int) {
    val fileName = getTestName(false) + ".test"
    val filePath = folderPath + fileName
    val ioFile = new File(filePath)
    var fileText: String = FileUtil.loadFile(ioFile, CharsetToolkit.UTF8)
    fileText = StringUtil.convertLineSeparators(fileText)
    val (input, expected) = separateText(fileText)
    myFixture.configureByText(fileName, input)
    PlatformTestUtil.startPerformanceTest("TypingTest" + getTestName(false), timeoutInMillis, new ThrowableRunnable[Nothing] {
      override def run(): Unit = {
        stringsToType.foreach(myFixture.`type`)
      }
    }).ioBound().assertTiming()
//    expected match {
//      case Some(expText) =>
//      case _ =>
//    }
  }

  protected def folderPath: String = TestUtils.getTestDataPath + "/typing/"

  protected def separateText(fileText: String): (String, Option[String]) = {
    fileText.indexOf("-----") match {
      case -1 => (fileText, None)
      case other =>
        val (before, after) = fileText.splitAt(other)
        (before, Some(after.dropWhile(c => c == '-' || c == '\n')))
    }
  }
}
<commit_msg>Fixed typing performance tests<commit_after>package org.jetbrains.plugins.scala.performance.typing

import java.io.File

import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.CharsetToolkit
import com.intellij.testFramework.PlatformTestUtil
import com.intellij.util.ThrowableRunnable
import org.jetbrains.plugins.scala.base.ScalaFixtureTestCase
import org.jetbrains.plugins.scala.util.TestUtils

/**
  * Author: <NAME>
  * Date: 10/29/15.
  */
abstract class TypingTestWithPerformanceTestBase extends ScalaFixtureTestCase {
  def doTest(stringsToType: List[String], timeoutInMillis: Int) {
    val fileName = getTestName(true) + ".test"
    val filePath = folderPath + fileName
    val ioFile = new File(filePath)
    var fileText: String = FileUtil.loadFile(ioFile, CharsetToolkit.UTF8)
    fileText = StringUtil.convertLineSeparators(fileText)
    val (input, _) = separateText(fileText)
    myFixture.configureByText(fileName, input)
    PlatformTestUtil.startPerformanceTest("TypingTest" + getTestName(false), timeoutInMillis, new ThrowableRunnable[Nothing] {
      override def run(): Unit = {
        stringsToType.foreach(myFixture.`type`)
      }
    }).ioBound().assertTiming()
  }

  protected def folderPath: String = TestUtils.getTestDataPath + "/typing/"

  protected def separateText(fileText: String): (String, Option[String]) = {
    fileText.indexOf("-----") match {
      case -1 => (fileText, None)
      case other =>
        val (before, after) = fileText.splitAt(other)
        (before, Some(after.dropWhile(c => c == '-' || c == '\n')))
    }
  }
}

{'fraction_non_alphanumeric': 0.1232876712328767, 'fraction_numerical': 0.004764740917212627, 'mean_word_length': 4.043543543543543, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '381270', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1059, 'n_words': 201}