mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
add test for getting array and void from struct
This commit is contained in:
@@ -73,6 +73,22 @@ func TestGoodStructMethodGet(t *testing.T) {
|
|||||||
payload: TestStruct{Bool: true},
|
payload: TestStruct{Bool: true},
|
||||||
expected: true,
|
expected: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "array data",
|
||||||
|
params: map[string]any{
|
||||||
|
"name": "GetData",
|
||||||
|
},
|
||||||
|
payload: TestStruct{Data: []string{"hello"}},
|
||||||
|
expected: []string{"hello"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "void",
|
||||||
|
params: map[string]any{
|
||||||
|
"name": "Void",
|
||||||
|
},
|
||||||
|
payload: TestStruct{},
|
||||||
|
expected: nil,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user