(t *testing.T)
| 2812 | } |
| 2813 | |
| 2814 | func TestPrinterPrintAltWhile(t *testing.T) { |
| 2815 | o := bytes.NewBufferString("") |
| 2816 | |
| 2817 | p := printer.NewPrinter(o) |
| 2818 | p.Print(&stmt.AltWhile{ |
| 2819 | Cond: &expr.Variable{ |
| 2820 | VarName: &node.Identifier{Value: "a"}, |
| 2821 | }, |
| 2822 | Stmt: &stmt.StmtList{ |
| 2823 | Stmts: []node.Node{ |
| 2824 | &stmt.Expression{Expr: &expr.Variable{ |
| 2825 | VarName: &node.Identifier{Value: "b"}, |
| 2826 | }}, |
| 2827 | }, |
| 2828 | }, |
| 2829 | }) |
| 2830 | |
| 2831 | expected := `while($a):$b;endwhile;` |
| 2832 | actual := o.String() |
| 2833 | |
| 2834 | if expected != actual { |
| 2835 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 2836 | } |
| 2837 | } |
| 2838 | |
| 2839 | func TestPrinterPrintStmtBreak(t *testing.T) { |
| 2840 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…