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

Function TestPrintReference

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

Source from the content-addressed store, hash-verified

431}
432
433func TestPrintReference(t *testing.T) {
434 o := bytes.NewBufferString("")
435
436 p := printer.NewPrettyPrinter(o, " ")
437 p.Print(&assign.Reference{
438 Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
439 Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
440 })
441
442 expected := `$a =& $b`
443 actual := o.String()
444
445 if expected != actual {
446 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
447 }
448}
449
450func TestPrintAssignBitwiseAnd(t *testing.T) {
451 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…