akka/akka-core

Use TypeCheckedTripleEquals in Typed tests

Open

#28,511 opened on Jan 23, 2020

View on GitHub
 (4 comments) (0 reactions) (0 assignees)Scala (3,547 forks)batch import
1 - triagedhelp wantedt:testingt:typed

Repository metrics

Stars
 (13,277 stars)
PR merge metrics
 (Avg merge 8d 19h) (10 merged PRs in 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?

Contributor guide