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

Function TestPrinterPrintArray

printer/printer_test.go:1370–1386  ·  view source on GitHub ↗

cast

(t *testing.T)

Source from the content-addressed store, hash-verified

1368// cast
1369
1370func TestPrinterPrintArray(t *testing.T) {
1371 o := bytes.NewBufferString("")
1372
1373 p := printer.NewPrinter(o)
1374 p.Print(&cast.Array{
1375 Expr: &expr.Variable{
1376 VarName: &node.Identifier{Value: "var"},
1377 },
1378 })
1379
1380 expected := `(array)$var`
1381 actual := o.String()
1382
1383 if expected != actual {
1384 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1385 }
1386}
1387
1388func TestPrinterPrintBool(t *testing.T) {
1389 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…