(t *testing.T)
| 3125 | } |
| 3126 | |
| 3127 | func TestPrinterPrintStmtConstList(t *testing.T) { |
| 3128 | o := bytes.NewBufferString("") |
| 3129 | |
| 3130 | p := printer.NewPrinter(o) |
| 3131 | p.Print(&stmt.ConstList{ |
| 3132 | Consts: []node.Node{ |
| 3133 | &stmt.Constant{ |
| 3134 | ConstantName: &node.Identifier{Value: "FOO"}, |
| 3135 | Expr: &scalar.String{Value: "'a'"}, |
| 3136 | }, |
| 3137 | &stmt.Constant{ |
| 3138 | ConstantName: &node.Identifier{Value: "BAR"}, |
| 3139 | Expr: &scalar.String{Value: "'b'"}, |
| 3140 | }, |
| 3141 | }, |
| 3142 | }) |
| 3143 | |
| 3144 | expected := `const FOO='a',BAR='b';` |
| 3145 | actual := o.String() |
| 3146 | |
| 3147 | if expected != actual { |
| 3148 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 3149 | } |
| 3150 | } |
| 3151 | |
| 3152 | func TestPrinterPrintStmtConstant(t *testing.T) { |
| 3153 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…