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

Function TestPrintInt

printer/pretty_printer_test.go:1165–1179  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1163}
1164
1165func TestPrintInt(t *testing.T) {
1166 o := bytes.NewBufferString("")
1167
1168 p := printer.NewPrettyPrinter(o, " ")
1169 p.Print(&cast.Int{
1170 Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}},
1171 })
1172
1173 expected := `(int)$var`
1174 actual := o.String()
1175
1176 if expected != actual {
1177 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1178 }
1179}
1180
1181func TestPrintObject(t *testing.T) {
1182 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…