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

Function TestPrintVariable

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

Source from the content-addressed store, hash-verified

2029}
2030
2031func TestPrintVariable(t *testing.T) {
2032 o := bytes.NewBufferString("")
2033
2034 p := printer.NewPrettyPrinter(o, " ")
2035 p.Print(&expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "var"}}})
2036
2037 expected := `$$var`
2038 actual := o.String()
2039
2040 if expected != actual {
2041 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2042 }
2043}
2044
2045func TestPrintYieldFrom(t *testing.T) {
2046 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…