Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions test/shared/src/main/scala/zio/test/Assertion.scala
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,66 @@ object Assertion extends AssertionVariants {
def isPositive[A](implicit num: Numeric[A]): Assertion[A] =
isGreaterThan(num.zero)

/**
* Makes a new assertions that requires a double value is not a number (NaN).
*/
def isNaNDouble: Assertion[Double] =
Assertion.assertion("isNaNDouble")()(_.isNaN)

/**
* Makes a new assertions that requires a float value is not a number (NaN).
*/
def isNaNFloat: Assertion[Float] =
Assertion.assertion("isNaNFloat")()(_.isNaN)

/**
* Makes a new assertions that requires a double value is positive infinity.
*/
def isPosInfinityDouble: Assertion[Double] =
Assertion.assertion("isPosInfinityDouble")()(_.isPosInfinity)

/**
* Makes a new assertions that requires a float value is positive infinity.
*/
def isPosInfinityFloat: Assertion[Float] =
Assertion.assertion("isPosInfinityFloat")()(_.isPosInfinity)

/**
* Makes a new assertions that requires a double value is negative infinity.
*/
def isNegInfinityDouble: Assertion[Double] =
Assertion.assertion("isNegInfinityDouble")()(_.isNegInfinity)

/**
* Makes a new assertions that requires a float value is negative infinity.
*/
def isNegInfinityFloat: Assertion[Float] =
Assertion.assertion("isNegInfinityFloat")()(_.isNegInfinity)

/**
* Makes a new assertions that requires a double value is finite.
*/
def isFiniteDouble: Assertion[Double] =
Assertion.assertion("isFiniteDouble")()(_.abs <= Double.MaxValue)

/**
* Makes a new assertions that requires a float value is finite.
*/
def isFiniteFloat: Assertion[Float] =
Assertion.assertion("isFiniteFloat")()(_.abs <= Float.MaxValue)

/**
* Makes a new assertions that requires a double value is infinite.
*/
def isInfiniteDouble: Assertion[Double] =
Assertion.assertion("isInfiniteDouble")()(_.isInfinite)

/**
* Makes a new assertions that requires a float value is infinite.
*/
def isInfiniteFloat: Assertion[Float] =
Assertion.assertion("isInfiniteFloat")()(_.isInfinite)

/**
* Makes a new assertion that requires a Right value satisfying a specified
* assertion.
Expand Down