(t *testing.T)
| 3291 | } |
| 3292 | |
| 3293 | func TestPrinterPrintStmtDo_Expression(t *testing.T) { |
| 3294 | o := bytes.NewBufferString("") |
| 3295 | |
| 3296 | p := printer.NewPrinter(o) |
| 3297 | p.Print(&stmt.Do{ |
| 3298 | Cond: &scalar.Lnumber{Value: "1"}, |
| 3299 | Stmt: &stmt.Expression{ |
| 3300 | Expr: &expr.Variable{ |
| 3301 | VarName: &node.Identifier{Value: "a"}, |
| 3302 | }, |
| 3303 | }, |
| 3304 | }) |
| 3305 | |
| 3306 | expected := `do $a;while(1);` |
| 3307 | actual := o.String() |
| 3308 | |
| 3309 | if expected != actual { |
| 3310 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 3311 | } |
| 3312 | } |
| 3313 | |
| 3314 | func TestPrinterPrintStmtDo_StmtList(t *testing.T) { |
| 3315 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…