Skip to content

Commit

Permalink
chore: issue test
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 committed Mar 28, 2023
1 parent c50678b commit 929f1aa
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions issue_test/issue379_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,40 +32,52 @@ func TestIssue379(t *testing.T) {
} {
{
data: `{"Name":"MyPtr"}`,
newf: func() interface{} { ptr := MyPtr(&Foo{}); return &ptr },
newf: func() interface{} { return &Foo{} },
},
{
data: `{"Name":"MyPtr"}`,
newf: func() interface{} { return MyPtr(&Foo{}) },
},
{
data: `{"Name":"MyPtr"}`,
newf: func() interface{} { return &Foo{} },
newf: func() interface{} { ptr := MyPtr(&Foo{}); return &ptr },
},
{
data: `null`,
newf: func() interface{} { ptr := MyPtr(&Foo{}); return &ptr },
newf: func() interface{} { return MyPtr(&Foo{}) },
},
{
data: `null`,
newf: func() interface{} { return &Foo{} },
},
{
data: `null`,
newf: func() interface{} { return MyPtr(&Foo{}) },
newf: func() interface{} { ptr := MyPtr(&Foo{}); return &ptr },
},
{
data: `{"map":{"Name":"MyPtr"}}`,
newf: func() interface{} { return new(map[string]MyPtr) },
},
{
data: `{"map":{"Name":"MyPtr"}}`,
newf: func() interface{} { return new(map[string]MyPtr) },
newf: func() interface{} { return new(map[string]*Foo) },
},
{
data: `{"map":{"Name":"MyPtr"}}`,
newf: func() interface{} { return new(map[string]*MyPtr) },
},
{
data: `[{"Name":"MyPtr"}]`,
newf: func() interface{} { return new([]MyPtr) },
},
{
data: `[{"Name":"MyPtr"}]`,
newf: func() interface{} { return new([]*MyPtr) },
},
{
data: `[{"Name":"MyPtr"}]`,
newf: func() interface{} { return new([]*Foo) },
},
}

for _, tt := range tests {
Expand Down

0 comments on commit 929f1aa

Please sign in to comment.