Skip to content

Commit

Permalink
Add a test for 13f832b (empty slice).
Browse files Browse the repository at this point in the history
  • Loading branch information
dato committed May 14, 2014
1 parent 1d45db7 commit e98a2de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ ArrayOfSlicesOfArrays = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
SliceOfMixedArrays = [[1, 2], ["a", "b"]]
ArrayOfMixedSlices = [[1, 2], ["a", "b"]]`,
},
"empty slice": {
input: struct { Empty []interface{} }{[]interface{}{}},
wantOutput: `Empty = []`,
},
"(error) slice with element type mismatch (string and integer)": {
input: struct{ Mixed []interface{} }{[]interface{}{1, "a"}},
wantError: ErrArrayMixedElementTypes,
Expand Down

0 comments on commit e98a2de

Please sign in to comment.