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

Function TestPrinterPrintBinaryMod

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

Source from the content-addressed store, hash-verified

1135}
1136
1137func TestPrinterPrintBinaryMod(t *testing.T) {
1138 o := bytes.NewBufferString("")
1139
1140 p := printer.NewPrinter(o)
1141 p.Print(&binary.Mod{
1142 Left: &expr.Variable{
1143 VarName: &node.Identifier{Value: "a"},
1144 },
1145 Right: &expr.Variable{
1146 VarName: &node.Identifier{Value: "b"},
1147 },
1148 })
1149
1150 expected := `$a%$b`
1151 actual := o.String()
1152
1153 if expected != actual {
1154 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1155 }
1156}
1157
1158func TestPrinterPrintBinaryMul(t *testing.T) {
1159 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…