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

Function TestPrinterPrintAssignDiv

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

Source from the content-addressed store, hash-verified

629}
630
631func TestPrinterPrintAssignDiv(t *testing.T) {
632 o := bytes.NewBufferString("")
633
634 p := printer.NewPrinter(o)
635 p.Print(&assign.Div{
636 Variable: &expr.Variable{
637 VarName: &node.Identifier{Value: "a"},
638 },
639 Expression: &expr.Variable{
640 VarName: &node.Identifier{Value: "b"},
641 },
642 })
643
644 expected := `$a/=$b`
645 actual := o.String()
646
647 if expected != actual {
648 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
649 }
650}
651
652func TestPrinterPrintAssignMinus(t *testing.T) {
653 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…