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

Function TestPrinterPrintString

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

Source from the content-addressed store, hash-verified

1458}
1459
1460func TestPrinterPrintString(t *testing.T) {
1461 o := bytes.NewBufferString("")
1462
1463 p := printer.NewPrinter(o)
1464 p.Print(&cast.String{
1465 Expr: &expr.Variable{
1466 VarName: &node.Identifier{Value: "var"},
1467 },
1468 })
1469
1470 expected := `(string)$var`
1471 actual := o.String()
1472
1473 if expected != actual {
1474 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1475 }
1476}
1477
1478func TestPrinterPrintUnset(t *testing.T) {
1479 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…