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

Function TestPrintExpression

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

Source from the content-addressed store, hash-verified

2987}
2988
2989func TestPrintExpression(t *testing.T) {
2990 o := bytes.NewBufferString("")
2991
2992 p := printer.NewPrettyPrinter(o, " ")
2993 p.Print(&stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}})
2994
2995 expected := `$a;`
2996 actual := o.String()
2997
2998 if expected != actual {
2999 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
3000 }
3001}
3002
3003func TestPrintStmtFinally(t *testing.T) {
3004 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…