Skip to content

Commit

Permalink
test: add a test for #40
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Nov 1, 2018
1 parent c6752ca commit 6b34486
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion obj/objFixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ var objFixtures = []struct {
{title: "empty",
sequence: fixtures.SequenceMap["empty"],
marshalResults: []marshalResults{
// not much marshals to empty!
// not much marshals to empty!
},
unmarshalResults: []unmarshalResults{
{title: "into string",
Expand Down Expand Up @@ -1044,6 +1044,8 @@ var objFixtures = []struct {
// valueFn: func() interface{} { return [0]int(nil) }},
{title: "from int slice",
valueFn: func() interface{} { return []int(nil) }},
{title: "from byte slice",
valueFn: func() interface{} { return []byte(nil) }},
//{title: "from iface array", // Not Possible! Compiler says: "cannot convert nil to type [0]interface {}"
// valueFn: func() interface{} { return [0]interface{}(nil) }},
{title: "from iface slice",
Expand Down Expand Up @@ -1099,6 +1101,9 @@ var objFixtures = []struct {
{title: "into *[]str",
slotFn: func() interface{} { var v []string; return &v },
valueFn: func() interface{} { return []string(nil) }},
{title: "into *[]byte",
slotFn: func() interface{} { var v []byte; return &v },
valueFn: func() interface{} { return []byte(nil) }},
{title: "into [0]str",
slotFn: func() interface{} { var v []string; return v },
expectErr: ErrInvalidUnmarshalTarget{reflect.TypeOf([]string{})}},
Expand Down

0 comments on commit 6b34486

Please sign in to comment.