<commit_before>import scala.meta._
import scala.meta.dialects.Scala211
import scala.meta.tql._
import scala.meta.internal.{ ast => impl }
import org.scalatest.FunSuite

class InferPartialSuite extends FunSuite {
  test("TransformAndInferDef") {
    val testCode =
      """import dummy.test
        |/* This high-level comment should be persisted */
        |case class Test(string: String)
        |object Test {
        |  val string = "This is a string"  
        |  def funToReplace(x: Int, y: String) {
        |    val myString = x.toString + ":" + y + string
        |    val res = {
        |      Test(myString) /* Just creating a new case object */
        |    }
        |    /* And yet another comment! */
        |  }
        |}
      """.stripMargin
    val testTree = testCode.parse[Source]

    // Forcing synthetic tokens using TQL
    val trans = (transform {
      case t: impl.Defn.Def if t.name.value == "funToReplace" => 
        t.copy(name = impl.Term.Name("aNewName")) andCollect Unit
    }).topDown

    val transformed = trans(testTree)
    val newCode = transformed.tree.get.tokens.map(_.show[Code]).mkString
    assert(newCode.contains("/* And yet another comment! */"))

    println(testTree.tokens.map(_.code).mkString)
    println("-----------")
    testTree.asInstanceOf[impl.Source].stats.foreach {s => println(s.tokens.map(_.code).mkString + "\n")}
  }

}<commit_msg>Adding one more modification to the partial suite<commit_after>import scala.meta._
import scala.meta.dialects.Scala211
import scala.meta.tql._
import scala.meta.internal.{ ast => impl }
import org.scalatest.FunSuite

class InferPartialSuite extends FunSuite {
  test("TransformAndInferDef") {
    val testCode =
      """import dummy.test
        |/* This high-level comment should be persisted */
        |case class Test(string: String)
        |object Test {
        |  val string = "This is a string"  
        |  def funToReplace(x: Int, y: String) {
        |    val myString = x.toString + ":" + y + string
        |    val res = {
        |      Test(myString) /* Just creating a new case object */
        |    }
        |    /* And yet another comment! */
        |  }
        |}
      """.stripMargin
    val testTree = testCode.parse[Source]

    // Forcing synthetic tokens using TQL
    val trans = (transform {
      case t: impl.Defn.Def if t.name.value == "funToReplace" => 
        t.copy(name = impl.Term.Name("aNewName")) andCollect Unit
      case t: impl.Defn.Val =>
        t.copy() andCollect Unit
    }).topDown

    val transformed = trans(testTree)
    val newCode = transformed.tree.get.tokens.map(_.show[Code]).mkString
    println("Printing original tokens:")
    println(testTree.tokens.map(_.code).mkString)
    println("-----------")
    println("Printing tokens corresponding to stats in Source:")
    testTree.asInstanceOf[impl.Source].stats.foreach {s => println(s.tokens.map(_.code).mkString + "\n")}
    println("-----------")
    println("Printing tokens after modification by TQL:")
    println(newCode)
    assert(newCode.contains("/* Just creating a new case object */"))
  }

}
{'fraction_non_alphanumeric': 0.13741191543882128, 'fraction_numerical': 0.0019218449711723255, 'mean_word_length': 2.447019867549669, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 10, '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': '3626771', 'n_tokens_mistral': 965, 'n_tokens_neox': 938, 'n_words': 237}