(t *testing.T)
| 4090 | } |
| 4091 | |
| 4092 | func TestPrinterPrintStmtListNested(t *testing.T) { |
| 4093 | o := bytes.NewBufferString("") |
| 4094 | |
| 4095 | p := printer.NewPrinter(o) |
| 4096 | p.Print(&stmt.StmtList{ |
| 4097 | Stmts: []node.Node{ |
| 4098 | &stmt.Expression{Expr: &expr.Variable{ |
| 4099 | VarName: &node.Identifier{Value: "a"}, |
| 4100 | }}, |
| 4101 | &stmt.StmtList{ |
| 4102 | Stmts: []node.Node{ |
| 4103 | &stmt.Expression{Expr: &expr.Variable{ |
| 4104 | VarName: &node.Identifier{Value: "b"}, |
| 4105 | }}, |
| 4106 | &stmt.StmtList{ |
| 4107 | Stmts: []node.Node{ |
| 4108 | &stmt.Expression{Expr: &expr.Variable{ |
| 4109 | VarName: &node.Identifier{Value: "c"}, |
| 4110 | }}, |
| 4111 | }, |
| 4112 | }, |
| 4113 | }, |
| 4114 | }, |
| 4115 | }, |
| 4116 | }) |
| 4117 | |
| 4118 | expected := `{$a;{$b;{$c;}}}` |
| 4119 | actual := o.String() |
| 4120 | |
| 4121 | if expected != actual { |
| 4122 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 4123 | } |
| 4124 | } |
| 4125 | |
| 4126 | func TestPrinterPrintStmtSwitch(t *testing.T) { |
| 4127 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…