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

Function TestPrinterPrintAssignBitwiseXor

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

Source from the content-addressed store, hash-verified

566}
567
568func TestPrinterPrintAssignBitwiseXor(t *testing.T) {
569 o := bytes.NewBufferString("")
570
571 p := printer.NewPrinter(o)
572 p.Print(&assign.BitwiseXor{
573 Variable: &expr.Variable{
574 VarName: &node.Identifier{Value: "a"},
575 },
576 Expression: &expr.Variable{
577 VarName: &node.Identifier{Value: "b"},
578 },
579 })
580
581 expected := `$a^=$b`
582 actual := o.String()
583
584 if expected != actual {
585 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
586 }
587}
588
589func TestPrinterPrintAssignCoalesce(t *testing.T) {
590 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…