kotest-assertions-core / io.kotest.matchers.doubles / kotlin.Double

Extensions for kotlin.Double

plusOrMinus

Creates a matcher for the interval [this - tolerance , this + tolerance]

infix fun Double.plusOrMinus(tolerance: Double): ToleranceMatcher

shouldBeBetween

Asserts that this Double is in the interval [a-tolerance , b+tolerance]

fun Double.shouldBeBetween(a: Double, b: Double, tolerance: Double): Unit

shouldBeExactly

Asserts that this Double is exactly other

infix fun Double.shouldBeExactly(other: Double): Unit

shouldBeGreaterThan

Asserts that this Double is strictly greater than x

infix fun Double.shouldBeGreaterThan(x: Double): Unit

shouldBeGreaterThanOrEqual

Asserts that this Double is greater than or equal to x

infix fun Double.shouldBeGreaterThanOrEqual(x: Double): Unit

shouldBeLessThan

Asserts that this Double is strictly less than x

infix fun Double.shouldBeLessThan(x: Double): Unit

shouldBeLessThanOrEqual

Asserts that this Double is less than or equal to x

infix fun Double.shouldBeLessThanOrEqual(x: Double): Unit

shouldBeNaN

Asserts that this Double is Double.NaN

fun Double.shouldBeNaN(): Unit

shouldBeNegative

Asserts that this Double is negative

fun Double.shouldBeNegative(): Unit

shouldBeNegativeInfinity

Verifies that this double is Double.NEGATIVE_INFINITY

fun Double.shouldBeNegativeInfinity(): Unit

shouldBePositive

Asserts that this Double is positive

fun Double.shouldBePositive(): Unit

shouldBePositiveInfinity

Verifies that this double is Double.POSITIVE_INFINITY

fun Double.shouldBePositiveInfinity(): Unit

shouldBeZero

Asserts that this Double is exactly zero (0.0).

fun Double.shouldBeZero(): Unit

shouldNotBeBetween

Asserts that this Double is NOT in the interval [a-tolerance , b+tolerance]

fun Double.shouldNotBeBetween(a: Double, b: Double, tolerance: Double): Unit

shouldNotBeExactly

Asserts that this Double is not exactly other

infix fun Double.shouldNotBeExactly(other: Double): Unit

shouldNotBeGreaterThan

Asserts that this Double is not strictly greater than x

infix fun Double.shouldNotBeGreaterThan(x: Double): Unit

shouldNotBeGreaterThanOrEqual

Asserts that this Double is not greater than x nor equal to x

infix fun Double.shouldNotBeGreaterThanOrEqual(x: Double): Unit

shouldNotBeLessThan

Asserts that this Double is not strictly less than x

infix fun Double.shouldNotBeLessThan(x: Double): Unit

shouldNotBeLessThanOrEqual

Asserts that this Double is not less than x nor equal to x

infix fun Double.shouldNotBeLessThanOrEqual(x: Double): Unit

shouldNotBeNaN

Assert that this Double is not Double.NaN

fun Double.shouldNotBeNaN(): Unit

shouldNotBeNegative

Asserts that this Double is not negative

fun Double.shouldNotBeNegative(): Unit

shouldNotBeNegativeInfinity

Verifies that this double is NOT Double.NEGATIVE_INFINITY

fun Double.shouldNotBeNegativeInfinity(): Unit

shouldNotBePositive

Asserts that this Double is not positive

fun Double.shouldNotBePositive(): Unit

shouldNotBePositiveInfinity

Verifies that this double is NOT Double.POSITIVE_INFINITY

fun Double.shouldNotBePositiveInfinity(): Unit

shouldNotBeZero

Asserts that this Double is not zero

fun Double.shouldNotBeZero(): Unit