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

Function TestPrinterPrintAssignShiftLeft

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

Source from the content-addressed store, hash-verified

755}
756
757func TestPrinterPrintAssignShiftLeft(t *testing.T) {
758 o := bytes.NewBufferString("")
759
760 p := printer.NewPrinter(o)
761 p.Print(&assign.ShiftLeft{
762 Variable: &expr.Variable{
763 VarName: &node.Identifier{Value: "a"},
764 },
765 Expression: &expr.Variable{
766 VarName: &node.Identifier{Value: "b"},
767 },
768 })
769
770 expected := `$a<<=$b`
771 actual := o.String()
772
773 if expected != actual {
774 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
775 }
776}
777
778func TestPrinterPrintAssignShiftRight(t *testing.T) {
779 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…