doc / ch.tutteli.atrium.api.infix.en_GB / only

only

object only : Keyword (source)

Represents the pseudo keyword only as in and only. It can be used for a parameterless function so that it has one parameter and thus can be used as infix function.

expect(listOf("A", "B")) toContain o inGiven order and only the values("A", "B")

fails {
    expect(listOf(5, 3, 2, 2, 4)) toContain o inAny order atMost 2 entry {
        toBeGreaterThan(2)
    }

}