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

Function TestPrintAssignDiv

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

Source from the content-addressed store, hash-verified

516}
517
518func TestPrintAssignDiv(t *testing.T) {
519 o := bytes.NewBufferString("")
520
521 p := printer.NewPrettyPrinter(o, " ")
522 p.Print(&assign.Div{
523 Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}},
524 Expression: &expr.Variable{VarName: &node.Identifier{Value: "b"}},
525 })
526
527 expected := `$a /= $b`
528 actual := o.String()
529
530 if expected != actual {
531 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
532 }
533}
534
535func TestPrintAssignMinus(t *testing.T) {
536 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…