(t *testing.T)
| 41 | } |
| 42 | |
| 43 | func TestReceiverVarArgMacro(t *testing.T) { |
| 44 | noopExpander := func(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { |
| 45 | return nil, nil |
| 46 | } |
| 47 | varArgMacro := ReceiverVarArgMacro("varargs", noopExpander) |
| 48 | if varArgMacro.ArgCount() != 0 { |
| 49 | t.Errorf("ArgCount() got %d, wanted 0", varArgMacro.ArgCount()) |
| 50 | } |
| 51 | if varArgMacro.Function() != "varargs" { |
| 52 | t.Errorf("Function() got %q, wanted 'varargs'", varArgMacro.Function()) |
| 53 | } |
| 54 | if varArgMacro.MacroKey() != "varargs:*:true" { |
| 55 | t.Errorf("MacroKey() got %q, wanted 'varargs:*:true'", varArgMacro.MacroKey()) |
| 56 | } |
| 57 | if !varArgMacro.IsReceiverStyle() { |
| 58 | t.Errorf("IsReceiverStyle() got %t, wanted true", varArgMacro.IsReceiverStyle()) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | func TestDocumentation(t *testing.T) { |
| 63 | noopExpander := func(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Expr, *common.Error) { |
nothing calls this directly
no test coverage detected