Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update upickle to 4.0.2 #2299

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ lazy val upickle = (projectMatrix in file("json/upickle"))
.settings(
name := "upickle",
libraryDependencies ++= Seq(
"com.lihaoyi" %%% "upickle" % "3.3.1"
"com.lihaoyi" %%% "upickle" % "4.0.2"
),
scalaTest,
// using macroRW causes a "match may not be exhaustive" error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ class UpickleTests extends AnyFlatSpec with Matchers with EitherValues {
RunResponseAs(responseAs)(body).right.value shouldBe expected
}

it should "decode None from empty array body" in {
it should "decode None from empty body" in {
import UsingDefaultReaderWriters._
import sttp.client4.upicklejson.default._

val responseAs = asJson[Option[Inner]]

RunResponseAs(responseAs)("[]").right.value shouldBe None
RunResponseAs(responseAs)("").right.value shouldBe None
}

it should "decode Left(None) from upickle notation" in {
Expand All @@ -49,7 +49,7 @@ class UpickleTests extends AnyFlatSpec with Matchers with EitherValues {

val responseAs = asJson[Either[Option[Inner], Outer]]

RunResponseAs(responseAs)("[0,[]]").right.value shouldBe Left(None)
RunResponseAs(responseAs)("[0,null]").right.value shouldBe Left(None)
}

it should "decode Right(None) from upickle notation" in {
Expand All @@ -58,7 +58,7 @@ class UpickleTests extends AnyFlatSpec with Matchers with EitherValues {

val responseAs = asJson[Either[Outer, Option[Inner]]]

RunResponseAs(responseAs)("[1,[]]").right.value shouldBe Right(None)
RunResponseAs(responseAs)("[1,null]").right.value shouldBe Right(None)
}

it should "fail to decode from empty input" in {
Expand Down
Loading