-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring Ring-like structures to ZIO Prelude (#351)
- Loading branch information
1 parent
b465abb
commit 6ada8f2
Showing
23 changed files
with
1,577 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
core-tests/shared/src/test/scala/zio/prelude/PartialInverseSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package zio.prelude | ||
|
||
import zio.prelude.laws._ | ||
import zio.prelude.newtypes.Prod | ||
import zio.test._ | ||
import zio.test.laws._ | ||
|
||
object PartialInverseSpec extends ZIOBaseSpec { | ||
|
||
private implicit val DoubleEqual: Equal[Double] = Equal.DoubleEqualWithEpsilon() | ||
private implicit val FloatEqual: Equal[Float] = Equal.FloatEqualWithEpsilon() | ||
|
||
def spec: Spec[Environment, Any] = | ||
suite("PartialInverseSpec")( | ||
suite("laws")( | ||
test("BigDecimal prod")( | ||
checkAllLaws(PartialInverseLaws)(Gen.bigDecimal(BigDecimal(-10), BigDecimal(10)).map(Prod(_))) | ||
), | ||
test("byte prod")(checkAllLaws(PartialInverseLaws)(Gen.byte.map(Prod(_)))), | ||
test("char prod")(checkAllLaws(PartialInverseLaws)(Gen.char.map(Prod(_)))), | ||
test("double prod")(checkAllLaws(PartialInverseLaws)(Gen.double.map(Prod(_)))), | ||
test("float prod")(checkAllLaws(PartialInverseLaws)(Gen.float.map(Prod(_)))), | ||
test("int prod")(checkAllLaws(PartialInverseLaws)(Gen.int.map(Prod(_)))), | ||
test("long prod")(checkAllLaws(PartialInverseLaws)(Gen.long.map(Prod(_)))), | ||
test("short prod")(checkAllLaws(PartialInverseLaws)(Gen.short.map(Prod(_)))) | ||
) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.