doc / ch.tutteli.atrium.api.fluent.en_GB / isSameAs

isSameAs

fun <T> Expect<T>.isSameAs(expected: T): Expect<T> (source)

Expects that the subject of this expectation is the same instance as expected.

val list = listOf(3)
expect(list).isSameAs(list)

fails {
    // fails because isSameAs is based on identity, use toBe for equality
    expect(listOf(3)).isSameAs(listOf(3))
}

Return
an Expect for the subject of this expectation.