(t *testing.T)
| 16 | } |
| 17 | |
| 18 | func TestGenerateWshCommandDecl_MultiArgs(t *testing.T) { |
| 19 | rtype := reflect.TypeOf((*testRpcInterfaceForDecls)(nil)).Elem() |
| 20 | method, ok := rtype.MethodByName("TwoArgCommand") |
| 21 | if !ok { |
| 22 | t.Fatalf("TwoArgCommand method not found") |
| 23 | } |
| 24 | decl := generateWshCommandDecl(method) |
| 25 | if decl.Command != "twoarg" { |
| 26 | t.Fatalf("expected command twoarg, got %q", decl.Command) |
| 27 | } |
| 28 | if len(decl.CommandDataTypes) != 2 { |
| 29 | t.Fatalf("expected 2 command data types, got %d", len(decl.CommandDataTypes)) |
| 30 | } |
| 31 | if decl.CommandDataTypes[0].Kind() != reflect.String || decl.CommandDataTypes[1].Kind() != reflect.Int { |
| 32 | t.Fatalf("unexpected command data types: %#v", decl.CommandDataTypes) |
| 33 | } |
| 34 | if len(decl.GetCommandDataTypes()) != 2 { |
| 35 | t.Fatalf("expected helper to return two command data types") |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func TestGenerateWshCommandDeclMap_TestMultiArgCommand(t *testing.T) { |
| 40 | decl := GenerateWshCommandDeclMap()["testmultiarg"] |
nothing calls this directly
no test coverage detected