(t *testing.T)
| 3904 | } |
| 3905 | |
| 3906 | func TestPrinterPrintNamespaceWithStmts(t *testing.T) { |
| 3907 | o := bytes.NewBufferString("") |
| 3908 | |
| 3909 | p := printer.NewPrinter(o) |
| 3910 | p.Print(&stmt.Namespace{ |
| 3911 | NamespaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, |
| 3912 | Stmts: []node.Node{ |
| 3913 | &stmt.Expression{Expr: &expr.Variable{ |
| 3914 | VarName: &node.Identifier{Value: "a"}, |
| 3915 | }}, |
| 3916 | }, |
| 3917 | }) |
| 3918 | |
| 3919 | expected := `namespace Foo{$a;}` |
| 3920 | actual := o.String() |
| 3921 | |
| 3922 | if expected != actual { |
| 3923 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 3924 | } |
| 3925 | } |
| 3926 | |
| 3927 | func TestPrinterPrintNop(t *testing.T) { |
| 3928 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…