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

Function TestPrinterPrintBinaryDiv

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

Source from the content-addressed store, hash-verified

946}
947
948func TestPrinterPrintBinaryDiv(t *testing.T) {
949 o := bytes.NewBufferString("")
950
951 p := printer.NewPrinter(o)
952 p.Print(&binary.Div{
953 Left: &expr.Variable{
954 VarName: &node.Identifier{Value: "a"},
955 },
956 Right: &expr.Variable{
957 VarName: &node.Identifier{Value: "b"},
958 },
959 })
960
961 expected := `$a/$b`
962 actual := o.String()
963
964 if expected != actual {
965 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
966 }
967}
968
969func TestPrinterPrintBinaryEqual(t *testing.T) {
970 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…