<commit_before>package org.jetbrains.plugins.scala.testingSupport.utest

/**
  * @author Roman.Shein
  * @since 05.09.2015.
  */
trait UTestPackageTest extends UTestTestCase {
  val packageName = "myPackage"
  val secondPackageName = "otherPackage"

  addSourceFile(packageName + "/Test1.scala",
    s"""
       |package myPackage
       |
       |$testSuiteSecondPrefix
       |import utest._
       |
       |object Test1 extends TestSuite {
       |  val tests = TestSuite {
       |    "test1" - {}
       |
       |    "test2" - {}
       |  }
       |}
      """.stripMargin.trim())

  addSourceFile(packageName + "/Test2.scala",
    s"""
       |package myPackage
       |
       |$testSuiteSecondPrefix
       |import utest._
       |
       |object Test2 extends TestSuite {
       |  val tests = TestSuite {
       |    "test1" - {}
       |
       |    "test2" - {}
       |  }
       |}
      """.stripMargin.trim())

  addSourceFile(secondPackageName + "/Test1.scala",
    s"""
       |package otherPackage
       |
       |$testSuiteSecondPrefix
       |import utest._
       |
       |object Test2 extends TestSuite {
       |  val tests = TestSuite {
       |    "test" - {}
       |  }
       |}
      """.stripMargin.trim())

  def testPackageTestRun(): Unit = {
    runTestByConfig(createTestFromPackage(packageName), checkPackageConfigAndSettings(_, packageName),
      root => checkResultTreeHasExactNamedPath(root, "[root]", "Test1", "tests", "test1") &&
        checkResultTreeHasExactNamedPath(root, "[root]", "Test1", "tests", "test2") &&
        checkResultTreeHasExactNamedPath(root, "[root]", "Test2", "tests", "test1") &&
        checkResultTreeHasExactNamedPath(root, "[root]", "Test2", "tests", "test2") &&
        checkResultTreeDoesNotHaveNodes(root, "test"),
      debug=true)
  }

  def testModuleTestRun(): Unit = {
    runTestByConfig(createTestFromModule(testClassName),
      checkPackageConfigAndSettings(_, generatedName = "ScalaTests in 'src'"),
      root => checkResultTreeHasExactNamedPath(root, "[root]", "Test1", "tests", "test1") &&
        checkResultTreeHasExactNamedPath(root, "[root]", "Test1", "tests", "test2") &&
        checkResultTreeHasExactNamedPath(root, "[root]", "Test2", "tests", "test1") &&<commit_msg>debug output setting in tests shouldn't be committed<commit_after>package org.jetbrains.plugins.scala.testingSupport.utest

/**
  * @author Roman.Shein
  * @since 05.09.2015.
  */
trait UTestPackageTest extends UTestTestCase {
  val packageName = "myPackage"
  val secondPackageName = "otherPackage"

  addSourceFile(packageName + "/Test1.scala",
    s"""
       |package myPackage
       |
       |$testSuiteSecondPrefix
       |import utest._
       |
       |object Test1 extends TestSuite {
       |  val tests = TestSuite {
       |    "test1" - {}
       |
       |    "test2" - {}
       |  }
       |}
      """.stripMargin.trim())

  addSourceFile(packageName + "/Test2.scala",
    s"""
       |package myPackage
       |
       |$testSuiteSecondPrefix
       |import utest._
       |
       |object Test2 extends TestSuite {
       |  val tests = TestSuite {
       |    "test1" - {}
       |
       |    "test2" - {}
       |  }
       |}
      """.stripMargin.trim())

  addSourceFile(secondPackageName + "/Test1.scala",
    s"""
       |package otherPackage
       |
       |$testSuiteSecondPrefix
       |import utest._
       |
       |object Test2 extends TestSuite {
       |  val tests = TestSuite {
       |    "test" - {}
       |  }
       |}
      """.stripMargin.trim())

  def testPackageTestRun(): Unit = {
    runTestByConfig(createTestFromPackage(packageName), checkPackageConfigAndSettings(_, packageName),
      root => checkResultTreeHasExactNamedPath(root, "[root]", "Test1", "tests", "test1") &&
        checkResultTreeHasExactNamedPath(root, "[root]", "Test1", "tests", "test2") &&
        checkResultTreeHasExactNamedPath(root, "[root]", "Test2", "tests", "test1") &&
        checkResultTreeHasExactNamedPath(root, "[root]", "Test2", "tests", "test2") &&
        checkResultTreeDoesNotHaveNodes(root, "test"))
  }

  def testModuleTestRun(): Unit = {
    runTestByConfig(createTestFromModule(testClassName),
      checkPackageConfigAndSettings(_, generatedName = "ScalaTests in 'src'"),
      root => checkResultTreeHasExactNamedPath(root, "[root]", "Test1", "tests", "test1") &&
        checkResultTreeHasExactNamedPath(root, "[root]", "Test1", "tests", "test2") &&
        checkResultTreeHasExactNamedPath(root, "[root]", "Test2", "tests", "test1") &&
{'fraction_non_alphanumeric': 0.14561827366571492, 'fraction_numerical': 0.01405666593454865, 'mean_word_length': 2.669621273166801, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4942795', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1390, 'n_words': 254}