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

Function TestPrinterPrintPostDec

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

Source from the content-addressed store, hash-verified

2109}
2110
2111func TestPrinterPrintPostDec(t *testing.T) {
2112 o := bytes.NewBufferString("")
2113
2114 p := printer.NewPrinter(o)
2115 p.Print(&expr.PostDec{
2116 Variable: &expr.Variable{
2117 VarName: &node.Identifier{Value: "var"},
2118 },
2119 })
2120
2121 expected := `$var--`
2122 actual := o.String()
2123
2124 if expected != actual {
2125 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2126 }
2127}
2128
2129func TestPrinterPrintPostInc(t *testing.T) {
2130 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…