<commit_before>package com.github.tminglei.slickpg

import org.junit._
import org.junit.Assert._
import scala.slick.driver.PostgresDriver
import scala.slick.jdbc.{StaticQuery => Q}
import java.sql.Timestamp
import java.text.SimpleDateFormat

object PgCompositeSupportTest {
  val tsFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
  def ts(str: String) = new Timestamp(tsFormat.parse(str).getTime)

  case class Composite1(
    id: Long,
    txt: String,
    date: Timestamp,
    tsRange: Option[Range[Timestamp]]
    )
  
  case class Composite2(
    id: Long,
    comp1: Composite1,
    confirm: Boolean
    )

  case class Composite3(
    name: String,
    code: Int,
    num: Int
    )

  //-------------------------------------------------------------
  object MyPostgresDriver1 extends MyPostgresDriver {
    override val Implicit = new ImplicitsPlus with CompositeImplicts {}
    override val simple = new SimpleQLPlus with CompositeImplicts {}

    ///
    trait CompositeImplicts {
      import utils.TypeConverters.Util._

      utils.TypeConverters.register(Range.mkRangeFn(ts))
      utils.TypeConverters.register(Range.toStringFn[Timestamp](tsFormat.format))

      utils.TypeConverters.register(mkCompositeConvFromString[Composite1])
      utils.TypeConverters.register(mkCompositeConvToString[Composite1])
      utils.TypeConverters.register(mkCompositeConvFromString[Composite2])
      utils.TypeConverters.register(mkCompositeConvToString[Composite2])
      utils.TypeConverters.register(mkCompositeConvFromString[Composite3])
      utils.TypeConverters.register(mkCompositeConvToString[Composite3])

      implicit val composite1TypeMapper = new GenericJdbcType[Composite1]("composite1",
        mkCompositeConvFromString[Composite1], mkCompositeConvToString[Composite1])
      implicit val composite2TypeMapper = new GenericJdbcType[Composite2]("composite2",
        mkCompositeConvFromString[Composite2], mkCompositeConvToString[Composite2])
      implicit val composite3TypeMapper = new GenericJdbcType[Composite3]("composite3",
        mkCompositeConvFromString[Composite3], mkCompositeConvToString[Composite3])
      implicit val composite1ArrayTypeMapper = new ArrayListJdbcType[Composite1]("composite1",
        mkArrayConvFromString[Composite1], mkArrayConvToString[Composite1])
      implicit val composite2ArrayTypeMapper = new ArrayListJdbcType[Composite2]("composite2",
        mkArrayConvFromString[Composite2], mkArrayConvToString[Composite2])
      implicit val composite3ArrayTypeMapper = new ArrayListJdbcType[Composite3]("composite3",
        mkArrayConvFromString[Composite3], mkArrayConvToString[Composite3])
    }
  }
}
<commit_msg>fix a minor error of PgCompositeSupportTest.scala<commit_after>package com.github.tminglei.slickpg

import org.junit._
import org.junit.Assert._
import scala.slick.driver.PostgresDriver
import scala.slick.jdbc.{StaticQuery => Q}
import java.sql.Timestamp
import java.text.SimpleDateFormat

object PgCompositeSupportTest {
  val tsFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
  def ts(str: String) = new Timestamp(tsFormat.parse(str).getTime)

  case class Composite1(
    id: Long,
    txt: String,
    date: Timestamp,
    tsRange: Option[Range[Timestamp]]
    )
  
  case class Composite2(
    id: Long,
    comp1: Composite1,
    confirm: Boolean
    )

  case class Composite3(
    name: String,
    code: Int,
    num: Int
    )

  //-------------------------------------------------------------
  object MyPostgresDriver1 extends MyPostgresDriver {
    override val Implicit = new ImplicitsPlus with CompositeImplicts {}
    override val simple = new SimpleQLPlus with CompositeImplicts {}

    ///
    trait CompositeImplicts {
      import utils.TypeConverters.Util._

      utils.TypeConverters.register(PgRangeSupportUtils.mkRangeFn(ts))
      utils.TypeConverters.register(PgRangeSupportUtils.toStringFn[Timestamp](tsFormat.format))

      utils.TypeConverters.register(mkCompositeConvFromString[Composite1])
      utils.TypeConverters.register(mkCompositeConvToString[Composite1])
      utils.TypeConverters.register(mkCompositeConvFromString[Composite2])
      utils.TypeConverters.register(mkCompositeConvToString[Composite2])
      utils.TypeConverters.register(mkCompositeConvFromString[Composite3])
      utils.TypeConverters.register(mkCompositeConvToString[Composite3])

      implicit val composite1TypeMapper = new GenericJdbcType[Composite1]("composite1",
        mkCompositeConvFromString[Composite1], mkCompositeConvToString[Composite1])
      implicit val composite2TypeMapper = new GenericJdbcType[Composite2]("composite2",
        mkCompositeConvFromString[Composite2], mkCompositeConvToString[Composite2])
      implicit val composite3TypeMapper = new GenericJdbcType[Composite3]("composite3",
        mkCompositeConvFromString[Composite3], mkCompositeConvToString[Composite3])
      implicit val composite1ArrayTypeMapper = new ArrayListJdbcType[Composite1]("composite1",
        mkArrayConvFromString[Composite1], mkArrayConvToString[Composite1])
      implicit val composite2ArrayTypeMapper = new ArrayListJdbcType[Composite2]("composite2",
        mkArrayConvFromString[Composite2], mkArrayConvToString[Composite2])
      implicit val composite3ArrayTypeMapper = new ArrayListJdbcType[Composite3]("composite3",
        mkArrayConvFromString[Composite3], mkArrayConvToString[Composite3])
    }
  }
}

{'fraction_non_alphanumeric': 0.10472848171407462, 'fraction_numerical': 0.015515330624307351, 'mean_word_length': 4.377358490566038, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1117537', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1568, 'n_words': 261}