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

Function TestPrinterPrintBinaryShiftLeft

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

Source from the content-addressed store, hash-verified

1261}
1262
1263func TestPrinterPrintBinaryShiftLeft(t *testing.T) {
1264 o := bytes.NewBufferString("")
1265
1266 p := printer.NewPrinter(o)
1267 p.Print(&binary.ShiftLeft{
1268 Left: &expr.Variable{
1269 VarName: &node.Identifier{Value: "a"},
1270 },
1271 Right: &expr.Variable{
1272 VarName: &node.Identifier{Value: "b"},
1273 },
1274 })
1275
1276 expected := `$a<<$b`
1277 actual := o.String()
1278
1279 if expected != actual {
1280 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1281 }
1282}
1283
1284func TestPrinterPrintBinaryShiftRight(t *testing.T) {
1285 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…