(t *testing.T)
| 2614 | } |
| 2615 | |
| 2616 | func TestPrinterPrintAltElse(t *testing.T) { |
| 2617 | o := bytes.NewBufferString("") |
| 2618 | |
| 2619 | p := printer.NewPrinter(o) |
| 2620 | p.Print(&stmt.AltElse{ |
| 2621 | Stmt: &stmt.StmtList{ |
| 2622 | Stmts: []node.Node{ |
| 2623 | &stmt.Expression{Expr: &expr.Variable{ |
| 2624 | VarName: &node.Identifier{Value: "b"}, |
| 2625 | }}, |
| 2626 | }, |
| 2627 | }, |
| 2628 | }) |
| 2629 | |
| 2630 | expected := `else:$b;` |
| 2631 | actual := o.String() |
| 2632 | |
| 2633 | if expected != actual { |
| 2634 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 2635 | } |
| 2636 | } |
| 2637 | |
| 2638 | func TestPrinterPrintAltElseEmpty(t *testing.T) { |
| 2639 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…