Skip to content

Commit

Permalink
Test precedence with duplicate paths at different depths
Browse files Browse the repository at this point in the history
Co-authored-by: Joao Azevedo <[email protected]>
  • Loading branch information
dianaamfr and jcazevedo authored Nov 21, 2024
1 parent 26164ce commit d177737
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions circe/src/test/scala/com/kevel/apso/circe/ImplicitsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ class ImplicitsSpec extends Specification {
}

"giving precedence to the last path value if duplicate paths exist" in {
val res = fromFullPaths(List("a" -> 1.asJson, "a" -> 2.asJson, "a" -> 3.asJson))
res mustEqual json"""{"a": 3}"""
val json1 = fromFullPaths(List("a" -> 1.asJson, "a" -> 2.asJson, "a" -> 3.asJson))
json1 mustEqual json"""{"a": 3}"""

val json2 = fromFullPaths(List("a.b.c" -> 1.asJson, "a.b" -> 2.asJson, "a" -> 3.asJson))
json2 mustEqual json"""{"a": 3}"""
}
}

Expand Down

0 comments on commit d177737

Please sign in to comment.