(t *testing.T)
| 1372 | } |
| 1373 | |
| 1374 | func TestPrintExprClosureUse(t *testing.T) { |
| 1375 | o := bytes.NewBufferString("") |
| 1376 | |
| 1377 | p := printer.NewPrettyPrinter(o, " ") |
| 1378 | p.Print(&expr.ClosureUse{ |
| 1379 | Uses: []node.Node{ |
| 1380 | &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}}, |
| 1381 | &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, |
| 1382 | }, |
| 1383 | }) |
| 1384 | |
| 1385 | expected := `use (&$foo, $bar)` |
| 1386 | actual := o.String() |
| 1387 | |
| 1388 | if expected != actual { |
| 1389 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1390 | } |
| 1391 | } |
| 1392 | |
| 1393 | func TestPrintExprClosure(t *testing.T) { |
| 1394 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…