(t *testing.T)
| 3408 | } |
| 3409 | |
| 3410 | func TestPrinterPrintStmtElseIfExpr(t *testing.T) { |
| 3411 | o := bytes.NewBufferString("") |
| 3412 | |
| 3413 | p := printer.NewPrinter(o) |
| 3414 | p.Print(&stmt.ElseIf{ |
| 3415 | Cond: &expr.Variable{ |
| 3416 | VarName: &node.Identifier{Value: "a"}, |
| 3417 | }, |
| 3418 | Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, |
| 3419 | }) |
| 3420 | |
| 3421 | expected := `elseif($a)'bar';` |
| 3422 | actual := o.String() |
| 3423 | |
| 3424 | if expected != actual { |
| 3425 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 3426 | } |
| 3427 | } |
| 3428 | |
| 3429 | func TestPrinterPrintStmtElseIfNop(t *testing.T) { |
| 3430 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…