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

Function TestPrinterPrintPreDec

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

Source from the content-addressed store, hash-verified

2145}
2146
2147func TestPrinterPrintPreDec(t *testing.T) {
2148 o := bytes.NewBufferString("")
2149
2150 p := printer.NewPrinter(o)
2151 p.Print(&expr.PreDec{
2152 Variable: &expr.Variable{
2153 VarName: &node.Identifier{Value: "var"},
2154 },
2155 })
2156
2157 expected := `--$var`
2158 actual := o.String()
2159
2160 if expected != actual {
2161 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2162 }
2163}
2164
2165func TestPrinterPrintPreInc(t *testing.T) {
2166 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…