(t *testing.T)
| 1179 | } |
| 1180 | |
| 1181 | func TestPrintObject(t *testing.T) { |
| 1182 | o := bytes.NewBufferString("") |
| 1183 | |
| 1184 | p := printer.NewPrettyPrinter(o, " ") |
| 1185 | p.Print(&cast.Object{ |
| 1186 | Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, |
| 1187 | }) |
| 1188 | |
| 1189 | expected := `(object)$var` |
| 1190 | actual := o.String() |
| 1191 | |
| 1192 | if expected != actual { |
| 1193 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1194 | } |
| 1195 | } |
| 1196 | |
| 1197 | func TestPrintString(t *testing.T) { |
| 1198 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…