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

Function TestPrinterPrintPostInc

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

Source from the content-addressed store, hash-verified

2127}
2128
2129func TestPrinterPrintPostInc(t *testing.T) {
2130 o := bytes.NewBufferString("")
2131
2132 p := printer.NewPrinter(o)
2133 p.Print(&expr.PostInc{
2134 Variable: &expr.Variable{
2135 VarName: &node.Identifier{Value: "var"},
2136 },
2137 })
2138
2139 expected := `$var++`
2140 actual := o.String()
2141
2142 if expected != actual {
2143 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2144 }
2145}
2146
2147func TestPrinterPrintPreDec(t *testing.T) {
2148 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…