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

Function TestPrinterPrintExpression

printer/printer_test.go:3500–3516  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3498}
3499
3500func TestPrinterPrintExpression(t *testing.T) {
3501 o := bytes.NewBufferString("")
3502
3503 p := printer.NewPrinter(o)
3504 p.Print(&stmt.Expression{
3505 Expr: &expr.Variable{
3506 VarName: &node.Identifier{Value: "a"},
3507 },
3508 })
3509
3510 expected := `$a;`
3511 actual := o.String()
3512
3513 if expected != actual {
3514 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
3515 }
3516}
3517
3518func TestPrinterPrintStmtFinally(t *testing.T) {
3519 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…