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

Function TestPrinterPrintPreInc

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

Source from the content-addressed store, hash-verified

2163}
2164
2165func TestPrinterPrintPreInc(t *testing.T) {
2166 o := bytes.NewBufferString("")
2167
2168 p := printer.NewPrinter(o)
2169 p.Print(&expr.PreInc{
2170 Variable: &expr.Variable{
2171 VarName: &node.Identifier{Value: "var"},
2172 },
2173 })
2174
2175 expected := `++$var`
2176 actual := o.String()
2177
2178 if expected != actual {
2179 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2180 }
2181}
2182
2183func TestPrinterPrintPrint(t *testing.T) {
2184 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…