(t *testing.T)
| 1458 | } |
| 1459 | |
| 1460 | func TestPrinterPrintString(t *testing.T) { |
| 1461 | o := bytes.NewBufferString("") |
| 1462 | |
| 1463 | p := printer.NewPrinter(o) |
| 1464 | p.Print(&cast.String{ |
| 1465 | Expr: &expr.Variable{ |
| 1466 | VarName: &node.Identifier{Value: "var"}, |
| 1467 | }, |
| 1468 | }) |
| 1469 | |
| 1470 | expected := `(string)$var` |
| 1471 | actual := o.String() |
| 1472 | |
| 1473 | if expected != actual { |
| 1474 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1475 | } |
| 1476 | } |
| 1477 | |
| 1478 | func TestPrinterPrintUnset(t *testing.T) { |
| 1479 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…