Add test for duplicate JSON keys for builtins.fromJSON
Related to #1162 Currently if JSON with duplicate object keys is passed into `builtins.toJSON`, it will silently drop all but the last value, keeping only the last. This may be surprising, but as this has been consistent reliable behavior that users might depend on, we should test for it. Change-Id: Icc2adefabb161530e7cbfa7330919bab6a6a6964
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{ key = "three"; }
|
||||
@@ -0,0 +1,8 @@
|
||||
# Duplicate JSON keys should always drop all but the latest value
|
||||
builtins.fromJSON ''
|
||||
{
|
||||
"key": "one",
|
||||
"key": "two",
|
||||
"key": "three"
|
||||
}
|
||||
''
|
||||
Reference in New Issue
Block a user