(t *testing.T)
| 4067 | } |
| 4068 | |
| 4069 | func TestPrinterPrintStmtList(t *testing.T) { |
| 4070 | o := bytes.NewBufferString("") |
| 4071 | |
| 4072 | p := printer.NewPrinter(o) |
| 4073 | p.Print(&stmt.StmtList{ |
| 4074 | Stmts: []node.Node{ |
| 4075 | &stmt.Expression{Expr: &expr.Variable{ |
| 4076 | VarName: &node.Identifier{Value: "a"}, |
| 4077 | }}, |
| 4078 | &stmt.Expression{Expr: &expr.Variable{ |
| 4079 | VarName: &node.Identifier{Value: "b"}, |
| 4080 | }}, |
| 4081 | }, |
| 4082 | }) |
| 4083 | |
| 4084 | expected := `{$a;$b;}` |
| 4085 | actual := o.String() |
| 4086 | |
| 4087 | if expected != actual { |
| 4088 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 4089 | } |
| 4090 | } |
| 4091 | |
| 4092 | func TestPrinterPrintStmtListNested(t *testing.T) { |
| 4093 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…