assertContains

fun <T> assertContains(iterable: Iterable<T>, element: T, message: String? = null)(source)

Asserts that the iterable contains the specified element, with an optional message.

Since Kotlin

1.5

fun <T> assertContains(sequence: Sequence<T>, element: T, message: String? = null)(source)

Asserts that the sequence contains the specified element, with an optional message.

Since Kotlin

1.5

fun <T> assertContains(array: Array<T>, element: T, message: String? = null)(source)
fun assertContains(array: ByteArray, element: Byte, message: String? = null)(source)
fun assertContains(array: ShortArray, element: Short, message: String? = null)(source)
fun assertContains(array: IntArray, element: Int, message: String? = null)(source)
fun assertContains(array: LongArray, element: Long, message: String? = null)(source)
fun assertContains(array: BooleanArray, element: Boolean, message: String? = null)(source)
fun assertContains(array: CharArray, element: Char, message: String? = null)(source)
fun assertContains(array: UByteArray, element: UByte, message: String? = null)(source)
fun assertContains(array: UShortArray, element: UShort, message: String? = null)(source)
fun assertContains(array: UIntArray, element: UInt, message: String? = null)(source)
fun assertContains(array: ULongArray, element: ULong, message: String? = null)(source)

Asserts that the array contains the specified element, with an optional message.

Since Kotlin

1.5

fun assertContains(range: IntRange, value: Int, message: String? = null)(source)
fun assertContains(range: LongRange, value: Long, message: String? = null)(source)
fun <T : Comparable<T>> assertContains(range: ClosedRange<T>, value: T, message: String? = null)(source)
fun assertContains(range: CharRange, value: Char, message: String? = null)(source)
fun assertContains(range: UIntRange, value: UInt, message: String? = null)(source)
fun assertContains(range: ULongRange, value: ULong, message: String? = null)(source)

Asserts that the range contains the specified value, with an optional message.

Since Kotlin

1.5

fun <K, V> assertContains(map: Map<K, V>, key: K, message: String? = null)(source)

Asserts that the map contains the specified key, with an optional message.

Since Kotlin

1.5

fun assertContains(charSequence: CharSequence, char: Char, ignoreCase: Boolean = false, message: String? = null)(source)

Asserts that the charSequence contains the specified char, with an optional message.

Since Kotlin

1.5

Parameters

ignoreCase

true to ignore character case when comparing characters. By default false.


fun assertContains(charSequence: CharSequence, other: CharSequence, ignoreCase: Boolean = false, message: String? = null)(source)

Asserts that the charSequence contains the specified other char sequence as a substring, with an optional message.

Since Kotlin

1.5

Parameters

ignoreCase

true to ignore character case when comparing strings. By default false.


fun assertContains(charSequence: CharSequence, regex: Regex, message: String? = null)(source)

Asserts that the charSequence contains at least one match of the specified regular expression regex, with an optional message.

Since Kotlin

1.5