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

Function TestPrinterPrintEmpty

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

Source from the content-addressed store, hash-verified

1797}
1798
1799func TestPrinterPrintEmpty(t *testing.T) {
1800 o := bytes.NewBufferString("")
1801
1802 p := printer.NewPrinter(o)
1803 p.Print(&expr.Empty{
1804 Expr: &expr.Variable{
1805 VarName: &node.Identifier{Value: "var"},
1806 },
1807 })
1808
1809 expected := `empty($var)`
1810 actual := o.String()
1811
1812 if expected != actual {
1813 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1814 }
1815}
1816
1817func TestPrinterPrettyPrinterrorSuppress(t *testing.T) {
1818 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…