MCPcopy Create free account
hub / github.com/z7zmey/php-parser / TestPrintObject

Function TestPrintObject

printer/pretty_printer_test.go:1181–1195  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1179}
1180
1181func 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
1197func TestPrintString(t *testing.T) {
1198 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrettyPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…