(t *testing.T)
| 3978 | } |
| 3979 | |
| 3980 | func TestPrinterPrintProperty(t *testing.T) { |
| 3981 | o := bytes.NewBufferString("") |
| 3982 | |
| 3983 | p := printer.NewPrinter(o) |
| 3984 | p.Print(&stmt.Property{ |
| 3985 | Variable: &expr.Variable{ |
| 3986 | FreeFloating: freefloating.Collection{ |
| 3987 | freefloating.Start: []freefloating.String{ |
| 3988 | { |
| 3989 | StringType: freefloating.TokenType, |
| 3990 | Value: "$", |
| 3991 | }, |
| 3992 | }, |
| 3993 | }, |
| 3994 | VarName: &node.Identifier{Value: "a"}, |
| 3995 | }, |
| 3996 | Expr: &scalar.Lnumber{Value: "1"}, |
| 3997 | }) |
| 3998 | |
| 3999 | expected := `$a=1` |
| 4000 | actual := o.String() |
| 4001 | |
| 4002 | if expected != actual { |
| 4003 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 4004 | } |
| 4005 | } |
| 4006 | |
| 4007 | func TestPrinterPrintReturn(t *testing.T) { |
| 4008 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…