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

Function TestPrinterPrintDouble

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

Source from the content-addressed store, hash-verified

1404}
1405
1406func TestPrinterPrintDouble(t *testing.T) {
1407 o := bytes.NewBufferString("")
1408
1409 p := printer.NewPrinter(o)
1410 p.Print(&cast.Double{
1411 Expr: &expr.Variable{
1412 VarName: &node.Identifier{Value: "var"},
1413 },
1414 })
1415
1416 expected := `(float)$var`
1417 actual := o.String()
1418
1419 if expected != actual {
1420 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1421 }
1422}
1423
1424func TestPrinterPrintInt(t *testing.T) {
1425 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…