(t *testing.T)
| 4468 | } |
| 4469 | |
| 4470 | func TestPrinterPrintWhileStmtList(t *testing.T) { |
| 4471 | o := bytes.NewBufferString("") |
| 4472 | |
| 4473 | p := printer.NewPrinter(o) |
| 4474 | p.Print(&stmt.While{ |
| 4475 | Cond: &expr.Variable{ |
| 4476 | VarName: &node.Identifier{Value: "a"}, |
| 4477 | }, |
| 4478 | Stmt: &stmt.StmtList{ |
| 4479 | Stmts: []node.Node{ |
| 4480 | &stmt.Expression{Expr: &expr.Variable{ |
| 4481 | VarName: &node.Identifier{Value: "a"}, |
| 4482 | }}, |
| 4483 | }, |
| 4484 | }, |
| 4485 | }) |
| 4486 | |
| 4487 | expected := `while($a){$a;}` |
| 4488 | actual := o.String() |
| 4489 | |
| 4490 | if expected != actual { |
| 4491 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 4492 | } |
| 4493 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…