From 510a8c95ce112617c33f8dfb865e752db0716cb1 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Mon, 25 Mar 2024 17:31:16 +0000 Subject: Fix another bug in inMapAt and inArrayAt --- json/write_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'json/write_test.go') diff --git a/json/write_test.go b/json/write_test.go index a0e8c3e..b495d94 100644 --- a/json/write_test.go +++ b/json/write_test.go @@ -263,6 +263,22 @@ func TestWrite(t *testing.T) { }, expected: `[[["a"],[]]]`, }, + { + values: []walk.Value { + walk.ArrayValue {{ + Index: 0, + Value: walk.MapValue {{ + Key: "a", + Value: walk.StringValue("a"), + }}, + }}, + walk.ArrayValue {{ + Index: 0, + Value: walk.MapValue{}, + }}, + }, + expected: `[{"a":"a"}]`, + }, } for i, test := range tests { -- cgit v1.2.3