(t *testing.T)
| 3099 | } |
| 3100 | |
| 3101 | func TestPrinterPrintStmtClassConstList(t *testing.T) { |
| 3102 | o := bytes.NewBufferString("") |
| 3103 | |
| 3104 | p := printer.NewPrinter(o) |
| 3105 | p.Print(&stmt.ClassConstList{ |
| 3106 | Modifiers: []node.Node{&node.Identifier{Value: "public"}}, |
| 3107 | Consts: []node.Node{ |
| 3108 | &stmt.Constant{ |
| 3109 | ConstantName: &node.Identifier{Value: "FOO"}, |
| 3110 | Expr: &scalar.String{Value: "'a'"}, |
| 3111 | }, |
| 3112 | &stmt.Constant{ |
| 3113 | ConstantName: &node.Identifier{Value: "BAR"}, |
| 3114 | Expr: &scalar.String{Value: "'b'"}, |
| 3115 | }, |
| 3116 | }, |
| 3117 | }) |
| 3118 | |
| 3119 | expected := `public const FOO='a',BAR='b';` |
| 3120 | actual := o.String() |
| 3121 | |
| 3122 | if expected != actual { |
| 3123 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 3124 | } |
| 3125 | } |
| 3126 | |
| 3127 | func TestPrinterPrintStmtConstList(t *testing.T) { |
| 3128 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…