Trait/Object

munit

Assertions

Related Docs: object Assertions | package munit

Permalink

trait Assertions extends CompileErrorMacro

Linear Supertypes
CompileErrorMacro, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Assertions
  2. CompileErrorMacro
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def assert(cond: ⇒ Boolean, clue: ⇒ Any = "assertion failed")(implicit loc: Location): Unit

    Permalink
  6. def assertEquals[A, B](obtained: A, expected: B, clue: ⇒ Any = "values are not the same")(implicit loc: Location, ev: <:<[B, A]): Unit

    Permalink

    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]
  7. def assertEqualsDouble(obtained: Double, expected: Double, delta: Double, clue: ⇒ Any = "values are not the same")(implicit loc: Location): Unit

    Permalink

    Asserts that two doubles are equal to within a positive delta.

    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.

  8. def assertEqualsFloat(obtained: Float, expected: Float, delta: Float, clue: ⇒ Any = "values are not the same")(implicit loc: Location): Unit

    Permalink

    Asserts that two floats are equal to within a positive delta.

    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.

  9. def assertNoDiff(obtained: String, expected: String, clue: ⇒ Any = "diff assertion failed")(implicit loc: Location): Unit

    Permalink
  10. def assertNotEquals[A, B](obtained: A, expected: B, clue: ⇒ Any = "values are the same")(implicit loc: Location, ev: =:=[A, B]): Unit

    Permalink
  11. def assume(cond: Boolean, clue: ⇒ Any = "assumption failed")(implicit loc: Location): Unit

    Permalink
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def clue[T](c: Clue[T]): T

    Permalink
  14. def clues(clue: Clue[_]*): Clues

    Permalink
  15. macro def compileErrors(code: String): String

    Permalink
    Definition Classes
    CompileErrorMacro
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def fail(message: String, clues: Clues = new Clues(Nil))(implicit loc: Location): Nothing

    Permalink
  19. def fail(message: String, cause: Throwable)(implicit loc: Location): Nothing

    Permalink
  20. def failSuite(message: String, clues: Clues = new Clues(Nil))(implicit loc: Location): Nothing

    Permalink
  21. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  23. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  24. def intercept[T <: Throwable](body: ⇒ Any)(implicit T: ClassTag[T], loc: Location): T

    Permalink
  25. def interceptMessage[T <: Throwable](expectedExceptionMessage: String)(body: ⇒ Any)(implicit T: ClassTag[T], loc: Location): T

    Permalink
  26. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  27. def munitAnsiColors: Boolean

    Permalink
  28. def munitCaptureClues[T](thunk: ⇒ T): (T, Clues)

    Permalink
  29. val munitLines: Lines

    Permalink
  30. def munitPrint(clue: ⇒ Any): String

    Permalink
  31. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  32. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  35. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CompileErrorMacro

Inherited from AnyRef

Inherited from Any

Ungrouped