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

Function TestPrinterPrintArgument

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

Source from the content-addressed store, hash-verified

203}
204
205func TestPrinterPrintArgument(t *testing.T) {
206 o := bytes.NewBufferString("")
207
208 p := printer.NewPrinter(o)
209 p.Print(&node.Argument{
210 IsReference: false,
211 Variadic: true,
212 Expr: &expr.Variable{
213 VarName: &node.Identifier{
214 Value: "var",
215 },
216 },
217 })
218
219 expected := "...$var"
220 actual := o.String()
221
222 if expected != actual {
223 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
224 }
225}
226func TestPrinterPrintArgumentByRef(t *testing.T) {
227 o := bytes.NewBufferString("")
228

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…