diff --git a/tests/functional2/lang/builtins.fromJSON/eval-okay-duplicate-keys.out.exp b/tests/functional2/lang/builtins.fromJSON/eval-okay-duplicate-keys.out.exp new file mode 100644 index 000000000..bba5bcfa8 --- /dev/null +++ b/tests/functional2/lang/builtins.fromJSON/eval-okay-duplicate-keys.out.exp @@ -0,0 +1 @@ +{ key = "three"; } diff --git a/tests/functional2/lang/builtins.fromJSON/in-duplicate-keys.nix b/tests/functional2/lang/builtins.fromJSON/in-duplicate-keys.nix new file mode 100644 index 000000000..009fc868d --- /dev/null +++ b/tests/functional2/lang/builtins.fromJSON/in-duplicate-keys.nix @@ -0,0 +1,8 @@ +# Duplicate JSON keys should always drop all but the latest value +builtins.fromJSON '' + { + "key": "one", + "key": "two", + "key": "three" + } +''