Skip to content

Commit

Permalink
Add test for putting an empty object
Browse files Browse the repository at this point in the history
  • Loading branch information
TomWright committed Nov 17, 2020
1 parent 8115ad3 commit a364f55
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions internal/command/root_put_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,39 @@ func TestRootCMD_Put_JSON(t *testing.T) {
]
}`, nil))

t.Run("EmptyObject", putObjectTest(`{
"numbers": [
{
"rank": 1,
"number": "one"
},
{
"rank": 2,
"number": "two"
},
{
"rank": 3,
"number": "three"
}
]
}`, "json", ".numbers.[]", []string{}, []string{}, `{
"numbers": [
{
"number": "one",
"rank": 1
},
{
"number": "two",
"rank": 2
},
{
"number": "three",
"rank": 3
},
{}
]
}`, nil))

t.Run("AppendObjectMulti", putObjectTest(`{
"numbers": [
{
Expand Down

0 comments on commit a364f55

Please sign in to comment.