(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func TestGenMethodCall_MultiArg(t *testing.T) { |
| 31 | methodDecl := &wshrpc.WshRpcMethodDecl{ |
| 32 | Command: "test", |
| 33 | CommandType: wshrpc.RpcType_Call, |
| 34 | MethodName: "TestCommand", |
| 35 | CommandDataTypes: []reflect.Type{reflect.TypeOf(""), reflect.TypeOf(0)}, |
| 36 | } |
| 37 | var sb strings.Builder |
| 38 | GenMethod_Call(&sb, methodDecl) |
| 39 | out := sb.String() |
| 40 | if !strings.Contains(out, "func TestCommand(w *wshutil.WshRpc, arg1 string, arg2 int, opts *wshrpc.RpcOpts) error {") { |
| 41 | t.Fatalf("generated method missing multi-arg signature:\n%s", out) |
| 42 | } |
| 43 | if !strings.Contains(out, "sendRpcRequestCallHelper[any](w, \"test\", wshrpc.MultiArg{Args: []any{arg1, arg2}}, opts)") { |
| 44 | t.Fatalf("generated method missing MultiArg payload:\n%s", out) |
| 45 | } |
| 46 | } |
nothing calls this directly
no test coverage detected