MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / TestGenMethodCall_MultiArg

Function TestGenMethodCall_MultiArg

pkg/gogen/gogen_test.go:30–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func 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}

Callers

nothing calls this directly

Calls 2

GenMethod_CallFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected