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

Function TestPrintAssignMod

printer/pretty_printer_test.go:552–567  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

550}
551
552func TestPrintAssignMod(t *testing.T) {
553 o := bytes.NewBufferString("")
554
555 p := printer.NewPrettyPrinter(o, " ")
556 p.Print(&assign.Mod{
557 Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
558 Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
559 })
560
561 expected := `$a %= $b`
562 actual := o.String()
563
564 if expected != actual {
565 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
566 }
567}
568
569func TestPrintAssignMul(t *testing.T) {
570 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrettyPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…