Skip to content

Commit

Permalink
Scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zmccoy committed May 25, 2022
1 parent 8aacac8 commit 70b55a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 6 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ val disciplineMunitVersion = "1.0.9"

val previousCirceGenericExtrasVersions = Set("0.14.0", "0.14.1")


def priorTo2_13(scalaVersion: String): Boolean =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, minor)) if minor < 13 => true
Expand Down Expand Up @@ -79,8 +78,12 @@ val allSettings = baseSettings ++ publishSettings
val docMappingsApiDir = settingKey[String]("Subdirectory in site target directory for API docs")

lazy val root =
project.in(file(".")).settings(allSettings).settings(noPublishSettings).aggregate(genericExtrasJVM, genericExtrasJS).disablePlugins(MimaPlugin)

project
.in(file("."))
.settings(allSettings)
.settings(noPublishSettings)
.aggregate(genericExtrasJVM, genericExtrasJS)
.disablePlugins(MimaPlugin)

lazy val genericExtras = crossProject(JSPlatform, JVMPlatform)
.withoutSuffixFor(JVMPlatform)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,15 @@ class ConfiguredAutoDerivedSuite extends CirceSuite {

test("Field with default should fail to decode it type in json is not correct") {
val json = json"""{"b": 1}"""
assertEquals(Decoder[FooWithDefault].decodeJson(json), Left(DecodingFailure(DecodingFailure.Reason.WrongTypeExpectation("string", Json.fromInt(1)), List(DownField("b")))))
assertEquals(
Decoder[FooWithDefault].decodeAccumulating(json.hcursor), Validated.invalidNel(
Decoder[FooWithDefault].decodeJson(json),
Left(
DecodingFailure(DecodingFailure.Reason.WrongTypeExpectation("string", Json.fromInt(1)), List(DownField("b")))
)
)
assertEquals(
Decoder[FooWithDefault].decodeAccumulating(json.hcursor),
Validated.invalidNel(
DecodingFailure(DecodingFailure.Reason.WrongTypeExpectation("string", Json.fromInt(1)), List(DownField("b")))
)
)
Expand Down

0 comments on commit 70b55a4

Please sign in to comment.