mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
add test for multiple return values
This commit is contained in:
@@ -44,6 +44,10 @@ func (t TestStruct) GetIntSlice() []int {
|
||||
|
||||
func (t TestStruct) Void() {}
|
||||
|
||||
func (t TestStruct) MultipleReturnValues() (string, int) {
|
||||
return t.String, t.Int
|
||||
}
|
||||
|
||||
type TestProcessor struct {
|
||||
}
|
||||
|
||||
|
||||
@@ -106,8 +106,15 @@ func TestGoodStructMethodGet(t *testing.T) {
|
||||
payload: TestStruct{IntSlice: []int{1, 2, 3}},
|
||||
expected: []int{1, 2, 3},
|
||||
},
|
||||
{
|
||||
name: "multiple return values",
|
||||
params: map[string]any{
|
||||
"name": "MultipleReturnValues",
|
||||
},
|
||||
payload: TestStruct{String: "hello", Int: 42},
|
||||
expected: []any{"hello", 42},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
registration, ok := processor.ProcessorRegistry["struct.method.get"]
|
||||
|
||||
Reference in New Issue
Block a user