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

Function TestPrintString

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

Source from the content-addressed store, hash-verified

1195}
1196
1197func 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
1213func TestPrintUnset(t *testing.T) {
1214 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…