(t *testing.T)
| 1195 | } |
| 1196 | |
| 1197 | func TestPrintString(t *testing.T) { |
| 1198 | o := bytes.NewBufferString("") |
| 1199 | |
| 1200 | p := printer.NewPrettyPrinter(o, " ") |
| 1201 | p.Print(&cast.String{ |
| 1202 | Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, |
| 1203 | }) |
| 1204 | |
| 1205 | expected := `(string)$var` |
| 1206 | actual := o.String() |
| 1207 | |
| 1208 | if expected != actual { |
| 1209 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1210 | } |
| 1211 | } |
| 1212 | |
| 1213 | func TestPrintUnset(t *testing.T) { |
| 1214 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…