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

Function TestPrinterPrintBinaryBitwiseOr

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

Source from the content-addressed store, hash-verified

820}
821
822func TestPrinterPrintBinaryBitwiseOr(t *testing.T) {
823 o := bytes.NewBufferString("")
824
825 p := printer.NewPrinter(o)
826 p.Print(&binary.BitwiseOr{
827 Left: &expr.Variable{
828 VarName: &node.Identifier{Value: "a"},
829 },
830 Right: &expr.Variable{
831 VarName: &node.Identifier{Value: "b"},
832 },
833 })
834
835 expected := `$a|$b`
836 actual := o.String()
837
838 if expected != actual {
839 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
840 }
841}
842
843func TestPrinterPrintBinaryBitwiseXor(t *testing.T) {
844 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…