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

Function TestPrinterPrintInt

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

Source from the content-addressed store, hash-verified

1422}
1423
1424func TestPrinterPrintInt(t *testing.T) {
1425 o := bytes.NewBufferString("")
1426
1427 p := printer.NewPrinter(o)
1428 p.Print(&cast.Int{
1429 Expr: &expr.Variable{
1430 VarName: &node.Identifier{Value: "var"},
1431 },
1432 })
1433
1434 expected := `(integer)$var`
1435 actual := o.String()
1436
1437 if expected != actual {
1438 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1439 }
1440}
1441
1442func TestPrinterPrintObject(t *testing.T) {
1443 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…