(t *testing.T)
| 2855 | } |
| 2856 | |
| 2857 | func TestPrinterPrintStmtCase(t *testing.T) { |
| 2858 | o := bytes.NewBufferString("") |
| 2859 | |
| 2860 | p := printer.NewPrinter(o) |
| 2861 | p.Print(&stmt.Case{ |
| 2862 | Cond: &expr.Variable{ |
| 2863 | VarName: &node.Identifier{Value: "a"}, |
| 2864 | }, |
| 2865 | Stmts: []node.Node{ |
| 2866 | &stmt.Expression{Expr: &expr.Variable{ |
| 2867 | VarName: &node.Identifier{Value: "a"}, |
| 2868 | }}, |
| 2869 | }, |
| 2870 | }) |
| 2871 | |
| 2872 | expected := `case $a:$a;` |
| 2873 | actual := o.String() |
| 2874 | |
| 2875 | if expected != actual { |
| 2876 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 2877 | } |
| 2878 | } |
| 2879 | |
| 2880 | func TestPrinterPrintStmtCaseEmpty(t *testing.T) { |
| 2881 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…