utest

package utest

Created by haoyi on 1/24/14.

Attributes

Members list

Packages

package utest.asserts
package utest.framework
package utest.runner
package utest.shaded

Type members

Classlikes

case class AssertionError(msgPrefix: String, captured: Seq[TestValue], cause: Throwable) extends AssertionError, ColorMessageError

A special AssertionError thrown by utest's macro-powered asserts that contains metadata about local variables used in the assert expression.

A special AssertionError thrown by utest's macro-powered asserts that contains metadata about local variables used in the assert expression.

Attributes

Companion
object
Supertypes
trait Product
trait Equals
class AssertionError
class Error
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Simplified versions of the errors thrown during compilation, for use with the utest.asserts.Asserts.assertCompileError macro. Contains only a single message and no position since things compiled using macros don't really have source positions.

Simplified versions of the errors thrown during compilation, for use with the utest.asserts.Asserts.assertCompileError macro. Contains only a single message and no position since things compiled using macros don't really have source positions.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Parse
class Type
object CompileError

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait CompileError
class Parse
class Type
Self type
case class NoSuchTestException(path: Seq[String]*) extends Exception

Indicates that there was no test to run at the path you provided

Indicates that there was no test to run at the path you provided

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
case class QueryParseError(input: String, msg: String) extends Exception

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object TestBuilder

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
class TestQueryParser(input: String)

Parses query strings.

Parses query strings.

Fastparse grammar:

val quoted: P[String] = P(""" ~/ CharsWhile(_ != '"').! ~ """) val ident: P[String] = P(CharIn('a' to 'z', 'A' to 'Z', "_-").rep(1).!) val item: P[String] = P(quoted | ident) val chain: P[Any] = P(item.rep(1, sep="." ~/) ~ ("." ~/ parseCurlies).?) val commas: P[Any] = P(chain.rep(1, sep=","~/)) val curlies: P[Any] = P(commas | "{" ~/ curlies ~ "}")

But here written manually to avoid the dependency on FastParse.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
object TestRunner

Created by lihaoyi on 12/9/17.

Created by lihaoyi on 12/9/17.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
TestRunner.type

Marker class used to mark an object as something containing tests. Used for test-discovery by SBT.

Marker class used to mark an object as something containing tests. Used for test-discovery by SBT.

Attributes

Companion
object
Supertypes
trait Executor
class Object
trait Matchable
class Any
Show all
Known subtypes
trait Retries

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
TestSuite.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TestSuite

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class TestSuite
trait Retries
sealed trait TestValue

Information about a value that was logged in one of the macro-powered assert functions

Information about a value that was logged in one of the macro-powered assert functions

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Equality
class Single
object TestValue

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
TestValue.type
case class Tests(nameTree: Tree[String], callTree: TestCallTree)

Represents a single hierarchy of tests, arranged in a tree structure, with every node having a name and an associated executable test.

Represents a single hierarchy of tests, arranged in a tree structure, with every node having a name and an associated executable test.

The two hierarchies are parallel: thus you can inspect the nameTree to browse the test listing without running anything, and once you decide which test to run you can feed the List[Int] path of that test in the nameTree into the callTree to execute it and return the result.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Tests extends TestsVersionSpecific

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
Tests.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Tests
object test

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
test.type

Inherited 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

Inherited from:
Asserts
Supertypes
class Object
trait Matchable
class Any

Types

type Show = Show

Value members

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
final def retry[T](n: Int)(body: => T): T

Attributes

Inherited from:
Asserts

Implicits

Implicits

implicit val retryMax: RetryMax

Inherited 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

Inherited from:
Asserts