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

Function TestPrinterPrintReference

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

Source from the content-addressed store, hash-verified

503}
504
505func TestPrinterPrintReference(t *testing.T) {
506 o := bytes.NewBufferString("")
507
508 p := printer.NewPrinter(o)
509 p.Print(&assign.Reference{
510 Variable: &expr.Variable{
511 VarName: &node.Identifier{Value: "a"},
512 },
513 Expression: &expr.Variable{
514 VarName: &node.Identifier{Value: "b"},
515 },
516 })
517
518 expected := `$a=&$b`
519 actual := o.String()
520
521 if expected != actual {
522 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
523 }
524}
525
526func TestPrinterPrintAssignBitwiseAnd(t *testing.T) {
527 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…