<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/json/write_test.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2024-03-25 17:31:16 +0000
committerCharlie Stanton <charlie@shtanton.xyz>2024-03-25 17:31:16 +0000
commit510a8c95ce112617c33f8dfb865e752db0716cb1 (patch)
tree4436165fb73891c5bde6f355b313d372827900b9 /json/write_test.go
parente9a296e8bc8f25138ea5910c8b09661f8ae25f10 (diff)
downloadstred-go-510a8c95ce112617c33f8dfb865e752db0716cb1.tar
Fix another bug in inMapAt and inArrayAt
Diffstat (limited to 'json/write_test.go')
-rw-r--r--json/write_test.go16
1 files changed, 16 insertions, 0 deletions
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 {