Assertions

object Assertions extends Assertions
Companion
class
class Object
trait Matchable
class Any

Value members

Inherited methods

def assert(cond: => Boolean, clue: => Any)(loc: Location): Unit
Inherited from
Assertions
def assertEquals[A, B](obtained: A, expected: B, clue: => Any)(loc: Location, ev: B <:< A): Unit

Asserts that two elements are equal using == equality.

Asserts that two elements are equal using == equality.

The "expected" value (second argument) must have the same type or be a subtype of the "obtained" value (first argument). For example:

 assertEquals(Option(1), Some(1)) // OK
 assertEquals(Some(1), Option(1)) // Error: Option[Int] is not a subtype of Some[Int]

Use assertEquals[Any, Any](a, b) as an escape hatch to compare two values of different types. For example:

 val a: Either[List[String], Int] = Right(42)
 val b: Either[String, Int]       = Right(42)
 assertEquals[Any, Any](a, b) // OK
 assertEquals(a, b) // Error: Either[String, Int] is not a subtype of Either[List[String], Int]
Inherited from
Assertions
def assertEqualsDouble(obtained: Double, expected: Double, delta: Double, clue: => Any)(loc: Location): Unit

Asserts that two doubles are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes.

Asserts that two doubles are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes.

Inherited from
Assertions
def assertEqualsFloat(obtained: Float, expected: Float, delta: Float, clue: => Any)(loc: Location): Unit

Asserts that two floats are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Float.NaN, Float.NaN, *) passes.

Asserts that two floats are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Float.NaN, Float.NaN, *) passes.

Inherited from
Assertions
def assertNoDiff(obtained: String, expected: String, clue: => Any)(loc: Location): Unit
Inherited from
Assertions
def assertNotEquals[A, B](obtained: A, expected: B, clue: => Any)(loc: Location, ev: A =:= B): Unit
Inherited from
Assertions
def assume(cond: Boolean, clue: => Any)(loc: Location): Unit
Inherited from
Assertions
def clue[T](c: Clue[T]): T
Inherited from
Assertions
def clues(clue: Clue[_]*): Clues
Inherited from
Assertions
inline def compileErrors(inline code: String): String
Inherited from
CompileErrorMacro
def fail(message: String, clues: Clues)(loc: Location): Nothing
Inherited from
Assertions
def fail(message: String, cause: Throwable)(loc: Location): Nothing
Inherited from
Assertions
def failComparison(message: String, obtained: Any, expected: Any, clues: Clues)(loc: Location): Nothing
Inherited from
Assertions
def failSuite(message: String, clues: Clues)(loc: Location): Nothing
Inherited from
Assertions
def intercept[T <: Throwable](body: => Any)(T: ClassTag[T], loc: Location): T
Inherited from
Assertions
def interceptMessage[T <: Throwable](expectedExceptionMessage: String)(body: => Any)(T: ClassTag[T], loc: Location): T
Inherited from
Assertions
def munitAnsiColors: Boolean
Inherited from
Assertions
def munitCaptureClues[T](thunk: => T): (T, Clues)
Inherited from
Assertions
def munitPrint(clue: => Any): String
Inherited from
Assertions

Inherited fields

Inherited from
Assertions