akka/akka-core

Use TypeCheckedTripleEquals in Typed tests

Aberta

#28.511 aberto em 23 de jan. de 2020

 (4 comentários) (0 reação) (0 responsável)Scala (3.547 forks)batch import
1 - triagedhelp wantedt:testingt:typed

Métricas do repositório

Stars
 (13.277 estrelas)
Métricas de merge de PR
 (Mesclagem média 8d 19h) (10 fundiu PRs em 30d)

Description

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?

Guia do colaborador