(t *testing.T)
| 3668 | } |
| 3669 | |
| 3670 | func TestPrintStmtListNested(t *testing.T) { |
| 3671 | o := bytes.NewBufferString("") |
| 3672 | |
| 3673 | p := printer.NewPrettyPrinter(o, " ") |
| 3674 | p.Print(&stmt.StmtList{ |
| 3675 | Stmts: []node.Node{ |
| 3676 | &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, |
| 3677 | &stmt.StmtList{ |
| 3678 | Stmts: []node.Node{ |
| 3679 | &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, |
| 3680 | &stmt.StmtList{ |
| 3681 | Stmts: []node.Node{ |
| 3682 | &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "c"}}}, |
| 3683 | }, |
| 3684 | }, |
| 3685 | }, |
| 3686 | }, |
| 3687 | }, |
| 3688 | }) |
| 3689 | |
| 3690 | expected := `{ |
| 3691 | $a; |
| 3692 | { |
| 3693 | $b; |
| 3694 | { |
| 3695 | $c; |
| 3696 | } |
| 3697 | } |
| 3698 | }` |
| 3699 | actual := o.String() |
| 3700 | |
| 3701 | if expected != actual { |
| 3702 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 3703 | } |
| 3704 | } |
| 3705 | |
| 3706 | func TestPrintStmtSwitch(t *testing.T) { |
| 3707 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…