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

Function TestPrinterPrintReturn

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

Source from the content-addressed store, hash-verified

4005}
4006
4007func TestPrinterPrintReturn(t *testing.T) {
4008 o := bytes.NewBufferString("")
4009
4010 p := printer.NewPrinter(o)
4011 p.Print(&stmt.Return{
4012 Expr: &scalar.Lnumber{Value: "1"},
4013 })
4014
4015 expected := `return 1;`
4016 actual := o.String()
4017
4018 if expected != actual {
4019 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
4020 }
4021}
4022
4023func TestPrinterPrintStaticVar(t *testing.T) {
4024 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…