akka/akka-core

Use TypeCheckedTripleEquals in Typed tests

开放

#28,511 创建于 2020年1月23日

 (4 条评论) (0 个反应) (0 位负责人)Scala (3,547 个派生)batch import
1 - triagedhelp wantedt:testingt:typed

仓库指标

星标
 (13,277 个星标)
PR 合并指标
 (平均合并 8天 19小时) (30 天内合并 10 个 PR)

描述

The `should ===("something") isn't checked at compile time if TypeCheckedTripleEquals isn't mixed in.

For classic tests we do that in AkkaSpec, but for Typed tests we haven't.

It will also need the following that we have in AkkaSpec:

  // for ScalaTest === compare of Class objects
  implicit def classEqualityConstraint[A, B]: CanEqual[Class[A], Class[B]] =
    new CanEqual[Class[A], Class[B]] {
      def areEqual(a: Class[A], b: Class[B]) = a == b
    }

  implicit def setEqualityConstraint[A, T <: Set[_ <: A]]: CanEqual[Set[A], T] =
    new CanEqual[Set[A], T] {
      def areEqual(a: Set[A], b: T) = a == b
    }

We don't want to have too much internal test utilities so that the Akka tests can be used as inspiration for users also. Should we add this to ScalaTestWithActorTestKit or is there a reason why someone don't want this?

贡献者指南