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

Function TestPrinterPrintUnaryPlus

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

Source from the content-addressed store, hash-verified

2475}
2476
2477func TestPrinterPrintUnaryPlus(t *testing.T) {
2478 o := bytes.NewBufferString("")
2479
2480 p := printer.NewPrinter(o)
2481 p.Print(&expr.UnaryPlus{
2482 Expr: &expr.Variable{
2483 VarName: &node.Identifier{Value: "var"},
2484 },
2485 })
2486
2487 expected := `+$var`
2488 actual := o.String()
2489
2490 if expected != actual {
2491 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2492 }
2493}
2494
2495func TestPrinterPrintVariable(t *testing.T) {
2496 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…