Skip to content

Commit

Permalink
Test that last path values take precedence over previous values
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaamfr committed Nov 20, 2024
1 parent b6b6cc4 commit 26164ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions circe/src/test/scala/com/kevel/apso/circe/ImplicitsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class ImplicitsSpec extends Specification {
val paths = (1 to 10000).map(i => (s"a.v$i", i.asJson)).toList
fromFullPaths(paths, ".") must not(throwAn[StackOverflowError])
}

"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}"""
}
}

"provide a method to get the key set of a JSON Object" in {
Expand Down

0 comments on commit 26164ce

Please sign in to comment.