Skip to content

Commit

Permalink
restore needed imports removed by scalafix, and apply formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
vreuter committed Jul 10, 2024
1 parent db8515c commit d0ea774
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions modules/numeric/src/test/scala/TestNonnegativeInt.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class TestNonnegativeInt
}

test("NonnegativeInt is a transparent type alias for Int :| Not[Negative]") {
import io.github.iltotore.iron.{ :|, autoRefine } // scalafix:ok
import io.github.iltotore.iron.{:|, autoRefine} // scalafix:ok
assertCompiles {
"val ironRef: Int :| Not[Negative] = 0; val aliased: NonnegativeInt = ironRef"
}
Expand All @@ -99,9 +99,12 @@ class TestNonnegativeInt
}: @nowarn

test("NonnegativeInt's predicate is Not[Negative], not GreaterEqual[0]") {
import io.github.iltotore.iron.{ :|, autoRefine } // scalafix:ok
import io.github.iltotore.iron.{:|, autoRefine} // scalafix:ok
import io.github.iltotore.iron.constraint.any.StrictEqual // scalafix:ok
import io.github.iltotore.iron.constraint.numeric.{ Greater, GreaterEqual} // scalafix:ok
import io.github.iltotore.iron.constraint.numeric.{
Greater,
GreaterEqual
} // scalafix:ok
/* With GreaterEqual[0] */
assertCompiles { "val ironRef: Int :| GreaterEqual[0] = 0" }
assertTypeError {
Expand Down
6 changes: 4 additions & 2 deletions modules/numeric/src/test/scala/TestPositiveInt.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package at.ac.oeaw.imba.gerlich.gerlib.numeric

import scala.annotation.nowarn
import scala.util.Try
import cats.syntax.all.*
import org.scalacheck.{Arbitrary, Gen}
Expand Down Expand Up @@ -86,12 +87,13 @@ class TestPositiveInt
}

test("PositiveInt is a transparent type alias for Int :| Positive") {

import io.github.iltotore.iron.{:|, autoRefine} // scalafix:ok
import io.github.iltotore.iron.constraint.numeric.Positive // scalafix:ok
assertCompiles {
"val ironRef: Int :| Positive = 1; val aliased: PositiveInt = ironRef"
}
assertCompiles {
"val aliased: PositiveInt = PositiveInt(1); val ironRef: Int :| Positive = aliased"
}
}
}: @nowarn
end TestPositiveInt

0 comments on commit d0ea774

Please sign in to comment.