trait Assertions extends CompileErrorMacro
- Alphabetic
- By Inheritance
- Assertions
- CompileErrorMacro
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def assert(cond: => Boolean, clue: => Any = "assertion failed")(implicit loc: Location): Unit
- def assertEquals[A, B](obtained: A, expected: B, clue: => Any = "values are not the same")(implicit 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]
- def assertEqualsDouble(obtained: Double, expected: Double, delta: Double, clue: => Any = "values are not the same")(implicit loc: Location): Unit
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.
- def assertEqualsFloat(obtained: Float, expected: Float, delta: Float, clue: => Any = "values are not the same")(implicit loc: Location): Unit
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.
- def assertNoDiff(obtained: String, expected: String, clue: => Any = "diff assertion failed")(implicit loc: Location): Unit
- def assertNotEquals[A, B](obtained: A, expected: B, clue: => Any = "values are the same")(implicit loc: Location, ev: =:=[A, B]): Unit
- def assume(cond: Boolean, clue: => Any = "assumption failed")(implicit loc: Location): Unit
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def clue[T](c: Clue[T]): T
- def clues(clue: Clue[_]*): Clues
- macro def compileErrors(code: String): String
- Definition Classes
- CompileErrorMacro
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fail(message: String, clues: Clues = new Clues(Nil))(implicit loc: Location): Nothing
- def fail(message: String, cause: Throwable)(implicit loc: Location): Nothing
- def failSuite(message: String, clues: Clues = new Clues(Nil))(implicit loc: Location): Nothing
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def intercept[T <: Throwable](body: => Any)(implicit T: ClassTag[T], loc: Location): T
- def interceptMessage[T <: Throwable](expectedExceptionMessage: String)(body: => Any)(implicit T: ClassTag[T], loc: Location): T
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def munitAnsiColors: Boolean
- def munitCaptureClues[T](thunk: => T): (T, Clues)
- val munitLines: Lines
- def munitPrint(clue: => Any): String
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()