From 26164ce6a4f7ccd64e487574c9b5e5c9d9557cf3 Mon Sep 17 00:00:00 2001 From: Diana Freitas Date: Wed, 20 Nov 2024 16:28:02 +0000 Subject: [PATCH] Test that last path values take precedence over previous values --- .../src/test/scala/com/kevel/apso/circe/ImplicitsSpec.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/circe/src/test/scala/com/kevel/apso/circe/ImplicitsSpec.scala b/circe/src/test/scala/com/kevel/apso/circe/ImplicitsSpec.scala index a49a9956..fd4085fe 100644 --- a/circe/src/test/scala/com/kevel/apso/circe/ImplicitsSpec.scala +++ b/circe/src/test/scala/com/kevel/apso/circe/ImplicitsSpec.scala @@ -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 {