MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / TestGetWshMethodDataParamsAndExpr_MultiArg

Function TestGetWshMethodDataParamsAndExpr_MultiArg

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

Source from the content-addressed store, hash-verified

12)
13
14func TestGetWshMethodDataParamsAndExpr_MultiArg(t *testing.T) {
15 methodDecl := &wshrpc.WshRpcMethodDecl{
16 CommandDataTypes: []reflect.Type{
17 reflect.TypeOf(""),
18 reflect.TypeOf(0),
19 },
20 }
21 params, expr := getWshMethodDataParamsAndExpr(methodDecl)
22 if params != ", arg1 string, arg2 int" {
23 t.Fatalf("unexpected params: %q", params)
24 }
25 if expr != "wshrpc.MultiArg{Args: []any{arg1, arg2}}" {
26 t.Fatalf("unexpected expr: %q", expr)
27 }
28}
29
30func TestGenMethodCall_MultiArg(t *testing.T) {
31 methodDecl := &wshrpc.WshRpcMethodDecl{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected