(t *testing.T)
| 2336 | } |
| 2337 | |
| 2338 | func TestPrintAltWhile(t *testing.T) { |
| 2339 | o := bytes.NewBufferString("") |
| 2340 | |
| 2341 | p := printer.NewPrettyPrinter(o, " ") |
| 2342 | p.Print(&stmt.Namespace{ |
| 2343 | Stmts: []node.Node{ |
| 2344 | &stmt.AltWhile{ |
| 2345 | Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, |
| 2346 | Stmt: &stmt.StmtList{ |
| 2347 | Stmts: []node.Node{ |
| 2348 | &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, |
| 2349 | }, |
| 2350 | }, |
| 2351 | }, |
| 2352 | }, |
| 2353 | }) |
| 2354 | |
| 2355 | expected := `namespace { |
| 2356 | while ($a) : |
| 2357 | $b; |
| 2358 | endwhile; |
| 2359 | }` |
| 2360 | actual := o.String() |
| 2361 | |
| 2362 | if expected != actual { |
| 2363 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 2364 | } |
| 2365 | } |
| 2366 | |
| 2367 | func TestPrintStmtBreak(t *testing.T) { |
| 2368 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…