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

Function TestPrinterPrintBinaryPlus

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

Source from the content-addressed store, hash-verified

1219}
1220
1221func TestPrinterPrintBinaryPlus(t *testing.T) {
1222 o := bytes.NewBufferString("")
1223
1224 p := printer.NewPrinter(o)
1225 p.Print(&binary.Plus{
1226 Left: &expr.Variable{
1227 VarName: &node.Identifier{Value: "a"},
1228 },
1229 Right: &expr.Variable{
1230 VarName: &node.Identifier{Value: "b"},
1231 },
1232 })
1233
1234 expected := `$a+$b`
1235 actual := o.String()
1236
1237 if expected != actual {
1238 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1239 }
1240}
1241
1242func TestPrinterPrintBinaryPow(t *testing.T) {
1243 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…