package asserts
Macro powered assert
s of all shapes and sizes. These asserts all use
macros to capture the names, types and values of variables used within
them, so you get nice error messages for free.
- Alphabetic
- By Inheritance
- asserts
- Asserts
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- type AssertEntry[T] = (String, ((TestValue) ⇒ Unit) ⇒ T)
- trait Asserts [V[_]] extends AnyRef
-
implicit
class
ArrowAssert
[T] extends AnyRef
Provides a nice syntax for asserting things are equal, that is pretty enough to embed in documentation and examples
Provides a nice syntax for asserting things are equal, that is pretty enough to embed in documentation and examples
- Definition Classes
- Asserts
- class DummyTypeclass [+T] extends AnyRef
-
case class
RetryInterval
(d: FiniteDuration) extends Product with Serializable
Used to specify a retry-interval for the
eventually
andcontinually
asserts. -
case class
RetryMax
(d: FiniteDuration) extends Product with Serializable
Used to specify a maximum retry duration for the
eventually
andcontinually
asserts. - class Show extends Annotation with StaticAnnotation
Abstract Value Members
-
abstract
def
assertPrettyPrint[T](t: T)(implicit arg0: DummyTypeclass[T]): String
- Definition Classes
- Asserts
Concrete Value Members
-
macro
def
assert(exprs: Boolean*): Unit
Checks that one or more expressions are true; otherwises raises an exception with some debugging info
Checks that one or more expressions are true; otherwises raises an exception with some debugging info
- Definition Classes
- Asserts
-
def
assertError(msgPrefix: String, logged: Seq[TestValue], cause: Throwable = null): Nothing
Shorthand to quickly throw a utest.AssertionError, together with all the macro-debugging goodness
-
macro
def
assertMatch(t: Any)(pf: PartialFunction[Any, Unit]): Unit
Asserts that the given value matches the PartialFunction.
Asserts that the given value matches the PartialFunction. Useful for using pattern matching to validate the shape of a data structure.
- Definition Classes
- Asserts
-
macro
def
compileError(expr: String): CompileError
Asserts that the given expression fails to compile, and returns a framework.CompileError containing the message of the failure.
Asserts that the given expression fails to compile, and returns a framework.CompileError containing the message of the failure. If the expression compile successfully, this macro itself will raise a compilation error.
- Definition Classes
- Asserts
-
macro
def
continually(exprs: Boolean*): Unit
Checks that one or more expressions all remain true within a certain period of time.
Checks that one or more expressions all remain true within a certain period of time. Polls at a regular interval to check this.
- Definition Classes
- Asserts
-
macro
def
eventually(exprs: Boolean*): Unit
Checks that one or more expressions all become true within a certain period of time.
Checks that one or more expressions all become true within a certain period of time. Polls at a regular interval to check this.
- Definition Classes
- Asserts
-
def
getAssertionEntry[T](t: AssertEntry[T]): (T, (Throwable) ⇒ Nothing)
Executes this AssertEntry and returns a successful result or dies in case of failure.
Executes this AssertEntry and returns a successful result or dies in case of failure. Even on success, it returns a die() function you can call to manually throw and exception later if the result displeases you.
-
macro
def
intercept[T](exprs: Unit)(implicit arg0: ClassTag[T]): T
Asserts that the given block raises the expected exception.
Asserts that the given block raises the expected exception. The exception is returned if raised, and an
AssertionError
is raised if the expected exception does not appear.- Definition Classes
- Asserts
-
final
def
retry[T](n: Int)(body: ⇒ T): T
- Definition Classes
- Asserts
- Annotations
- @tailrec()
-
def
runAssertionEntry[T](t: AssertEntry[T]): (Try[T], ArrayBuffer[TestValue], String)
Executes this AssertEntry and returns the raw results
- val utestTruncateLength: Int
-
object
Asserts
Macro implementation that provides rich error message for boolean expression assertion.
- object DummyTypeclass
-
object
Parallel
Asserts which only make sense when running on multiple threads.
-
object
Tracer
Macro implementation to take a block of code and trace through it, converting it into an AssertEntry and inserting debug loggers.