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

Function TestPrintArray

printer/pretty_printer_test.go:1117–1131  ·  view source on GitHub ↗

cast

(t *testing.T)

Source from the content-addressed store, hash-verified

1115// cast
1116
1117func TestPrintArray(t *testing.T) {
1118 o := bytes.NewBufferString("")
1119
1120 p := printer.NewPrettyPrinter(o, " ")
1121 p.Print(&cast.Array{
1122 Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}},
1123 })
1124
1125 expected := `(array)$var`
1126 actual := o.String()
1127
1128 if expected != actual {
1129 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1130 }
1131}
1132
1133func TestPrintBool(t *testing.T) {
1134 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrettyPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…