Asserts

utest.asserts.Asserts
See theAsserts companion object

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

implicit class ArrowAssert(lhs: Any)

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

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

final def retry[T](n: Int)(body: => T): T

Inherited methods

inline def assert(inline expr: Boolean*): Unit

Checks that one or more expressions are true; otherwise raises an exception with some debugging info

Checks that one or more expressions are true; otherwise raises an exception with some debugging info

Attributes

Inherited from:
AssertsVersionSpecific
transparent inline def assertCompileError(inline expr: String): CompileError

Asserts that the given expression fails to compile, and returns a utest.CompileError containing the message of the failure. If the expression compile successfully, this macro itself will raise a compilation error.

Asserts that the given expression fails to compile, and returns a utest.CompileError containing the message of the failure. If the expression compile successfully, this macro itself will raise a compilation error.

Attributes

Inherited from:
AssertsVersionSpecific
inline def assertContinually(inline expr: Boolean)(using ri: => RetryInterval, rm: => RetryMax): Unit

Checks that one or more expressions all remain true within a certain period of time. Polls at a regular interval to check this.

Checks that one or more expressions all remain true within a certain period of time. Polls at a regular interval to check this.

Attributes

Inherited from:
AssertsVersionSpecific
inline def assertEventually(inline expr: Boolean)(using ri: => RetryInterval, rm: => RetryMax): Unit

Checks that one or more expressions all become true within a certain period of time. Polls at a regular interval to check this.

Checks that one or more expressions all become true within a certain period of time. Polls at a regular interval to check this.

Attributes

Inherited from:
AssertsVersionSpecific
def assertGoldenFile(actualValue: String, goldenFilePath: Path)(implicit reporter: Reporter): Unit

Asserts that the String actualValue is equivalent to the contents of the file on disk at goldenFilePath. If UTEST_UPDATE_GOLDEN_TESTS=1 is set during the test run, the golden file is updated to the latest contents of actualValue

Asserts that the String actualValue is equivalent to the contents of the file on disk at goldenFilePath. If UTEST_UPDATE_GOLDEN_TESTS=1 is set during the test run, the golden file is updated to the latest contents of actualValue

Attributes

Inherited from:
AssertsPlatformSpecific
def assertGoldenLiteral(actualValue: Any, goldenLiteral: Span[Any])(implicit reporter: Reporter): Unit

Asserts that the String actualValue is equivalent to the contents of the goldenLiteral. If UTEST_UPDATE_GOLDEN_TESTS=1 is set during the test run, the source code of goldenLiteral is updated to the latest contents of actualValue pretty-printed using PPrint.

Asserts that the String actualValue is equivalent to the contents of the goldenLiteral. If UTEST_UPDATE_GOLDEN_TESTS=1 is set during the test run, the source code of goldenLiteral is updated to the latest contents of actualValue pretty-printed using PPrint.

Attributes

Inherited from:
AssertsPlatformSpecific
inline def assertMatch(inline t: Any)(pf: => PartialFunction[Any, Unit]): Unit

Asserts that the given value matches the PartialFunction. Useful for using pattern matching to validate the shape of a data structure.

Asserts that the given value matches the PartialFunction. Useful for using pattern matching to validate the shape of a data structure.

Attributes

Inherited from:
AssertsVersionSpecific
inline def assertThrows[T](inline expr: Unit): T

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.

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.

Attributes

Inherited from:
AssertsVersionSpecific

Implicits

Implicits

final implicit def ArrowAssert(lhs: Any): ArrowAssert

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

Attributes