| 162 | } |
| 163 | |
| 164 | func TestFuncWrapSimpleManyArg(t *testing.T) { |
| 165 | store := NewStore(NewEngine()) |
| 166 | f := WrapFunc(store, func(i1 int32, i2 int64, f1 float32, f2 float64) { |
| 167 | if i1 != 3 { |
| 168 | panic("wrong argument") |
| 169 | } |
| 170 | if i2 != 4 { |
| 171 | panic("wrong argument") |
| 172 | } |
| 173 | if f1 != 5 { |
| 174 | panic("wrong argument") |
| 175 | } |
| 176 | if f2 != 6 { |
| 177 | panic("wrong argument") |
| 178 | } |
| 179 | }) |
| 180 | result, trap := f.Call(store, 3, 4, float32(5.0), float64(6.0)) |
| 181 | require.Nil(t, trap) |
| 182 | require.Nil(t, result) |
| 183 | } |
| 184 | |
| 185 | func TestFuncWrapCallerArg(t *testing.T) { |
| 186 | store := NewStore(NewEngine()) |