Package-level declarations

Types

Link copied to clipboard
class AnyOf<T>(matchers: Iterable<Matcher<in T>>) : ShortcutCombination<T>

Calculates the logical disjunction of multiple matchers. Evaluation is shortcut, so subsequent matchers are not called if an earlier matcher returns true.

Link copied to clipboard
abstract class BaseDescription : Description

A Description that is stored as a string.

Link copied to clipboard
abstract class BaseMatcher<T> : Matcher<T>

BaseClass for all Matcher implementations.

Link copied to clipboard
interface Description

A description of a Matcher. A Matcher will describe itself to a description which can later be used for reporting.

Link copied to clipboard
interface Matcher<T> : SelfDescribing

A matcher over acceptable values. A matcher is able to describe itself to give feedback when it fails.

Link copied to clipboard
Link copied to clipboard
object Matchers
Link copied to clipboard
interface SelfDescribing

The ability of an object to describe itself.

Link copied to clipboard
abstract class ShortcutCombination<T>(matchers: Iterable<Matcher<in T>>) : BaseMatcher<T>
Link copied to clipboard
class StringDescription(out: Appendable = StringBuilder()) : BaseDescription

A Description that is stored as a string.

Functions

Link copied to clipboard
fun assertArrayEquals(expecteds: Array<String?>, actuals: Array<String?>, message: String? = null)

Asserts that two object arrays are equal. If they are not, an AssertionError is thrown. If expected and actual are null, they are considered equal.

fun assertArrayEquals(expecteds: ByteArray, actuals: ByteArray, message: String? = null)
fun assertArrayEquals(expected: DoubleArray, actual: DoubleArray, delta: Double, message: String? = null)
fun assertArrayEquals(expected: FloatArray, actual: FloatArray, delta: Float, message: String? = null)

ported from org.junit.Assert.assertArrayEquals

fun assertArrayEquals(expected: IntArray, actual: IntArray, message: String? = null)
fun assertArrayEquals(expected: LongArray, actual: LongArray, message: String? = null)
Link copied to clipboard
fun <T> assertEquals(expected: T, actual: T, message: String? = null)
fun assertEquals(expected: ByteArray, actual: ByteArray, message: String? = null)
fun assertEquals(expected: CharArray, actual: CharArray, message: String? = null)
fun assertEquals(expected: FloatArray, actual: FloatArray, message: String? = null)
fun assertEquals(expected: IntArray, actual: IntArray, message: String? = null)
fun assertEquals(expected: LongArray, actual: LongArray, message: String? = null)
fun assertEquals(expected: ByteArray, expectedFromIndex: Int, expectedToIndex: Int, actual: ByteArray, actualFromIndex: Int, actualToIndex: Int, message: String? = null)
Link copied to clipboard
fun <T> assertThat(actual: T, matcher: Matcher<in T>)

Asserts that actual satisfies the condition specified by matcher. If not, an AssertionError is thrown with information about the matcher and failing value. Example:

fun <T> assertThat(reason: String, actual: T, matcher: Matcher<in T>)

Asserts that actual satisfies the condition specified by matcher. If not, an AssertionError is thrown with the reason and information about the matcher and failing value. Example: