Skip to content

Commit

Permalink
chore(dependencies): update scalafmt-core to 3.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
broij committed Jan 21, 2025
1 parent 77d359d commit 4c63e49
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.0.8"
version = "3.8.5"
maxColumn = 120
align.preset = most
align.multiline = false
Expand Down
61 changes: 35 additions & 26 deletions src/test/scala-2/be/broij/zarrow/ZArrowSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,21 @@ object ZArrowSpec extends ZIOSpecDefault {
},
test("dies when the provided f: I => R => O throws") {
val exception = new Exception("unexpected!")
val zArrow = ZArrow.succeed { _: Int => _: String =>
throw exception
1
val zArrow = ZArrow.succeed {
_: Int => _: String =>
throw exception
1
}
check(Gen.int) { int =>
assertZIO(zArrow(int).provide(ZLayer.succeed("Test")).exit)(dies(equalTo(exception)))
}
},
test("dies when the provided f: I => O throws") {
val exception = new Exception("unexpected!")
val zArrow = ZArrow.succeed { _: Int =>
throw exception
1
val zArrow = ZArrow.succeed {
_: Int =>
throw exception
1
}
check(Gen.int) { int =>
assertZIO(zArrow(int).exit)(dies(equalTo(exception)))
Expand Down Expand Up @@ -128,19 +130,21 @@ object ZArrowSpec extends ZIOSpecDefault {
},
test("dies when the provided f: I => R1 => ZIO[R, E, O] throws") {
val exception = new Exception("unexpected!")
val zArrow = ZArrow.fromZIO { _: Int => _: String =>
throw exception
ZIO.succeed(1)
val zArrow = ZArrow.fromZIO {
_: Int => _: String =>
throw exception
ZIO.succeed(1)
}
check(Gen.int) { int =>
assertZIO(zArrow(int).provide(ZLayer.succeed("Test")).exit)(dies(equalTo(exception)))
}
},
test("dies when the provided f: I => ZIO[R, E, O] throws") {
val exception = new Exception("unexpected!")
val zArrow = ZArrow.fromZIO { _: Int =>
throw exception
ZIO.succeed(1)
val zArrow = ZArrow.fromZIO {
_: Int =>
throw exception
ZIO.succeed(1)
}
check(Gen.int) { int =>
val a = zArrow(int).exit
Expand Down Expand Up @@ -184,19 +188,21 @@ object ZArrowSpec extends ZIOSpecDefault {
},
test("fails when the provided f: I => R => O throws") {
val exception = new Exception("unexpected!")
val zArrow = ZArrow.attempt { _: Int => _: String =>
throw exception
1
val zArrow = ZArrow.attempt {
_: Int => _: String =>
throw exception
1
}
check(Gen.int) { int =>
assertZIO(zArrow(int).provide(ZLayer.succeed("Test")).exit)(fails(equalTo(exception)))
}
},
test("fails when the provided f: I => O throws") {
val exception = new Exception("unexpected!")
val zArrow = ZArrow.attempt { _: Int =>
throw exception
1
val zArrow = ZArrow.attempt {
_: Int =>
throw exception
1
}
check(Gen.int) { int =>
assertZIO(zArrow(int).exit)(fails(equalTo(exception)))
Expand Down Expand Up @@ -239,19 +245,21 @@ object ZArrowSpec extends ZIOSpecDefault {
},
test("fails when the provided f: I => R1 => ZIO[R, E, O] throws") {
val exception = new Exception("unexpected!")
val zArrow = ZArrow.fromZIOAttempt { _: Int => _: String =>
throw exception
ZIO.succeed(1)
val zArrow = ZArrow.fromZIOAttempt {
_: Int => _: String =>
throw exception
ZIO.succeed(1)
}
check(Gen.int) { int =>
assertZIO(zArrow(int).provide(ZLayer.succeed("Test")).exit)(fails(equalTo(exception)))
}
},
test("fails when the provided f: I => ZIO[R, E, O] throws") {
val exception = new Exception("unexpected!")
val zArrow = ZArrow.fromZIOAttempt { _: Int =>
throw exception
ZIO.succeed(1)
val zArrow = ZArrow.fromZIOAttempt {
_: Int =>
throw exception
ZIO.succeed(1)
}
check(Gen.int) { int =>
assertZIO(zArrow(int).exit)(fails(equalTo(exception)))
Expand Down Expand Up @@ -653,8 +661,9 @@ object ZArrowSpec extends ZIOSpecDefault {
suite(".flatMapError")(
test("applies the provided function and the ZArrow it gives to the failures of the original ZArrow") {
val failingAdder = ZArrow.fromZIO { int: Int => ZIO.fail(int * 2) }
val zArrow = failingAdder.flatMapError { a: Int =>
ZArrow.succeed { b: Int => (b * a) + 1 }
val zArrow = failingAdder.flatMapError {
a: Int =>
ZArrow.succeed { b: Int => (b * a) + 1 }
}
check(genTuple(Gen.int)) { case (a, b) =>
assertZIO(zArrow((a, b)).exit)(fails(equalTo(((a * 2) * b) + 1)))
Expand Down

0 comments on commit 4c63e49

Please sign in to comment.