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

Function TestPrinterPrintAssignPlus

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

Source from the content-addressed store, hash-verified

713}
714
715func TestPrinterPrintAssignPlus(t *testing.T) {
716 o := bytes.NewBufferString("")
717
718 p := printer.NewPrinter(o)
719 p.Print(&assign.Plus{
720 Variable: &expr.Variable{
721 VarName: &node.Identifier{Value: "a"},
722 },
723 Expression: &expr.Variable{
724 VarName: &node.Identifier{Value: "b"},
725 },
726 })
727
728 expected := `$a+=$b`
729 actual := o.String()
730
731 if expected != actual {
732 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
733 }
734}
735
736func TestPrinterPrintAssignPow(t *testing.T) {
737 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…