Skip to content

Commit

Permalink
Remove Java BigDecimal and BigInteger instances (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaychandran committed Oct 6, 2023
1 parent cbbd01c commit 0ef299f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
12 changes: 0 additions & 12 deletions main/src/io/github/iltotore/iron/constraint/any.scala
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,3 @@ object any:

inline given [V <: Int | Long]: StrictEqualConstraint[BigInt, V] with
override inline def test(value: BigInt): Boolean = value == BigInt(longValue[V])

inline given jBigDecimalDouble[V <: Float | Double]: StrictEqualConstraint[java.math.BigDecimal, V] with
override inline def test(value: java.math.BigDecimal): Boolean =
value == java.math.BigDecimal.valueOf(doubleValue[V])

inline given jBigDecimalLong[V <: Int | Long]: StrictEqualConstraint[java.math.BigDecimal, V] with
override inline def test(value: java.math.BigDecimal): Boolean =
value == java.math.BigDecimal.valueOf(longValue[V])

inline given jBigInteger[V <: Int | Long]: StrictEqualConstraint[java.math.BigInteger, V] with
override inline def test(value: java.math.BigInteger): Boolean =
value == java.math.BigInteger.valueOf(longValue[V])
4 changes: 0 additions & 4 deletions main/test/src/io/github/iltotore/iron/testing/AnySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ object AnySuite extends TestSuite:
test - BigDecimal(1).assertNotRefine[StrictEqual[0]]
test - BigInt(0).assertRefine[StrictEqual[0]]
test - BigInt(1).assertNotRefine[StrictEqual[0]]
test - java.math.BigDecimal("0").assertRefine[StrictEqual[0]]
test - java.math.BigDecimal("1").assertNotRefine[StrictEqual[0]]
test - java.math.BigInteger("0").assertRefine[StrictEqual[0]]
test - java.math.BigInteger("1").assertNotRefine[StrictEqual[0]]
}

test("in") {
Expand Down

0 comments on commit 0ef299f

Please sign in to comment.