(t *testing.T)
| 1519 | } |
| 1520 | |
| 1521 | func TestPrintFunctionCall(t *testing.T) { |
| 1522 | o := bytes.NewBufferString("") |
| 1523 | |
| 1524 | p := printer.NewPrettyPrinter(o, " ") |
| 1525 | p.Print(&expr.FunctionCall{ |
| 1526 | Function: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, |
| 1527 | ArgumentList: &node.ArgumentList{ |
| 1528 | Arguments: []node.Node{ |
| 1529 | &node.Argument{ |
| 1530 | IsReference: true, |
| 1531 | Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, |
| 1532 | }, |
| 1533 | &node.Argument{ |
| 1534 | Variadic: true, |
| 1535 | Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, |
| 1536 | }, |
| 1537 | &node.Argument{ |
| 1538 | Expr: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, |
| 1539 | }, |
| 1540 | }, |
| 1541 | }, |
| 1542 | }) |
| 1543 | |
| 1544 | expected := `$var(&$a, ...$b, $c)` |
| 1545 | actual := o.String() |
| 1546 | |
| 1547 | if expected != actual { |
| 1548 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1549 | } |
| 1550 | } |
| 1551 | |
| 1552 | func TestPrintInclude(t *testing.T) { |
| 1553 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…