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

Function TestPrintPostDec

printer/pretty_printer_test.go:1701–1715  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1699}
1700
1701func TestPrintPostDec(t *testing.T) {
1702 o := bytes.NewBufferString("")
1703
1704 p := printer.NewPrettyPrinter(o, " ")
1705 p.Print(&expr.PostDec{
1706 Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}},
1707 })
1708
1709 expected := `$var--`
1710 actual := o.String()
1711
1712 if expected != actual {
1713 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1714 }
1715}
1716
1717func TestPrintPostInc(t *testing.T) {
1718 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrettyPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…