All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.assertions.sc Maven / Gradle / Ivy

There is a newer version: 4.0.78
Show newest version
def assertContains[A](name: String, actual: IterableOnce[A], expected: IterableOnce[A]) = {
  val actualSet = actual.iterator.to(Set)

  val missing = expected.iterator.filterNot(actualSet.contains).toSeq
  if (missing.nonEmpty)
    throw new AssertionError(s"""$name did not contain the following expected element(s):
         |$missing
         |Actual elements:
         |${actual.iterator.mkString(System.lineSeparator)}""".mkString) with scala.util.control.NoStackTrace
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy