Skip to content

Commit

Permalink
Merge pull request #74 from scala-steward/update/zio-2.0.0-RC6
Browse files Browse the repository at this point in the history
Update zio, zio-streams, zio-test, ... to 2.0.0-RC6
  • Loading branch information
vigoo authored May 3, 2022
2 parents 39e3d64 + 6ca50df commit ec965b6
Show file tree
Hide file tree
Showing 11 changed files with 720 additions and 646 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import zio.test._

/** Tests whether the benchmark examples run with success */
object BenchmarksSpec extends ZIOSpecDefault {
override def spec: ZSpec[TestEnvironment, Any] =
override def spec: Spec[TestEnvironment, Any] =
suite("Benchmarks")(
suite("basic")(
testParserBenchmark("RepeatAnyChar", new RepeatAnyChar),
Expand Down Expand Up @@ -45,7 +45,7 @@ object BenchmarksSpec extends ZIOSpecDefault {
private def testParserBenchmark[T](
name: String,
create: => ParserBenchmark[T]
): Spec[Any, TestFailure[Nothing], TestSuccess] = {
): Spec[Any, Nothing] = {
val benchmark = create
benchmark.setUp()

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ addCommandAlias(
";zioParserNative/test"
)

val zioVersion = "2.0.0-RC5"
val zioVersion = "2.0.0-RC6"

lazy val root = (project in file("."))
.aggregate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,15 +795,15 @@ object CalibanParser {
// case Right(result) =>
// IO.succeed(Document(result._2.definitions,sm))
// }
Task
ZIO
.attempt(document.parseString(query))
.mapError(ex => ParsingError(s"Internal parsing error", innerThrowable = Some(ex)))
.flatMap {
case Left(error) =>
// IO.fail(ParsingError(error.toString, Some(sm.getLocation(error.failedAtOffset))))
IO.fail(ParsingError(error.toString, None))
ZIO.fail(ParsingError(error.toString, None))
case Right(result) =>
IO.succeed(Document(result.definitions, sm))
ZIO.succeed(Document(result.definitions, sm))
}
}

Expand Down Expand Up @@ -896,13 +896,13 @@ object CalibanDemo extends ZIOAppDefault {
""".trim

val parsed: ZIO[Any, Nothing, Either[Parser.ParserError[String], StringValue]] =
UIO
ZIO
.succeed(CalibanParser.stringValue.parseString(query))
// val parsed = UIO(CalibanSyntax.stringValue.parse("\"\"\"hello\"\"\""))
.tap {
case Left(_) => UIO.unit
case Left(_) => ZIO.unit
case Right(value) =>
UIO.succeed(value.getClass).debug("CLASS")
ZIO.succeed(value.getClass).debug("CLASS")
}

// Debug.printParserTree(CalibanParser.document.asParser.optimized)
Expand Down
Loading

0 comments on commit ec965b6

Please sign in to comment.