Skip to content

Commit

Permalink
Revert "marshals nil slices/arrays like expected and equivalent to js…
Browse files Browse the repository at this point in the history
…on.marshal"

This reverts commit ecc6ca1.
  • Loading branch information
mweibel committed May 9, 2023
1 parent 29f7986 commit 798c3d1
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions sheriff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,20 +763,6 @@ func TestMarshal_NilSlice(t *testing.T) {
jsonResult, err := json.Marshal(marshalSlice)
assert.NoError(t, err)

expect := "null"

assert.Equal(t, expect, string(jsonResult))
}

func TestMarshal_EmptySlice(t *testing.T) {
var stringSlice = []string{} // empty slice

marshalSlice, err := Marshal(&Options{}, stringSlice)
assert.NoError(t, err)

jsonResult, err := json.Marshal(marshalSlice)
assert.NoError(t, err)

expect := "[]"

assert.Equal(t, expect, string(jsonResult))
Expand Down

0 comments on commit 798c3d1

Please sign in to comment.