(t *testing.T)
| 4425 | } |
| 4426 | |
| 4427 | func TestPrinterPrintStmtUseList(t *testing.T) { |
| 4428 | o := bytes.NewBufferString("") |
| 4429 | |
| 4430 | p := printer.NewPrinter(o) |
| 4431 | p.Print(&stmt.UseList{ |
| 4432 | UseType: &node.Identifier{Value: "function"}, |
| 4433 | Uses: []node.Node{ |
| 4434 | &stmt.Use{ |
| 4435 | Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, |
| 4436 | Alias: &node.Identifier{Value: "Bar"}, |
| 4437 | }, |
| 4438 | &stmt.Use{ |
| 4439 | Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, |
| 4440 | }, |
| 4441 | }, |
| 4442 | }) |
| 4443 | |
| 4444 | expected := `use function Foo as Bar,Baz;` |
| 4445 | actual := o.String() |
| 4446 | |
| 4447 | if expected != actual { |
| 4448 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 4449 | } |
| 4450 | } |
| 4451 | |
| 4452 | func TestPrinterPrintUse(t *testing.T) { |
| 4453 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…