utest

asserts

package asserts

Macro powered asserts 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.

Linear Supertypes
Asserts[DummyTypeclass], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. asserts
  2. Asserts
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. 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

  2. type AssertEntry[T] = (String, ((LoggedValue) ⇒ Unit) ⇒ T)

  3. trait Asserts[V[_]] extends AnyRef

  4. class DummyTypeclass[+T] extends AnyRef

  5. case class RetryInterval(d: FiniteDuration) extends Product with Serializable

    Used to specify a retry-interval for the eventually and continually asserts.

  6. case class RetryMax(d: FiniteDuration) extends Product with Serializable

    Used to specify a maximum retry duration for the eventually and continually asserts.

  7. class Show extends Annotation with StaticAnnotation

Abstract Value Members

  1. abstract def assertPrettyPrint[T](t: T)(implicit arg0: V[T]): String

    Definition Classes
    Asserts

Concrete Value Members

  1. object Asserts

    Macro implementation that provides rich error message for boolean expression assertion.

  2. object DummyTypeclass

  3. object Parallel

    Asserts which only make sense when running on multiple threads.

  4. object Tracer

    Macro implementation to take a block of code and trace through it, converting it into an AssertEntry and inserting debug loggers.

  5. 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
    Annotations
    @macroImpl( ... )
  6. def assertError(msgPrefix: String, logged: Seq[LoggedValue], cause: Throwable = null): Nothing

    Shorthand to quickly throw a utest.

    Shorthand to quickly throw a utest.AssertionError, together with all the macro-debugging goodness

  7. 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
    Annotations
    @macroImpl( ... )
  8. 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
    Annotations
    @macroImpl( ... )
  9. 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
    Annotations
    @macroImpl( ... )
  10. 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
    Annotations
    @macroImpl( ... )
  11. def getAssertionEntry[T](t: (String, ((LoggedValue) ⇒ Unit) ⇒ 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.

  12. 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
    Annotations
    @macroImpl( ... )
  13. final def retry[T](n: Int)(body: ⇒ T): T

    Definition Classes
    Asserts
    Annotations
    @tailrec()
  14. def runAssertionEntry[T](t: (String, ((LoggedValue) ⇒ Unit) ⇒ T)): (Try[T], ArrayBuffer[LoggedValue], String)

    Executes this AssertEntry and returns the raw results

  15. val utestTruncateLength: Int

Inherited from Asserts[DummyTypeclass]

Inherited from AnyRef

Inherited from Any

Ungrouped