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

Function TestPrinterPrintExprConstFetch

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

Source from the content-addressed store, hash-verified

1781}
1782
1783func TestPrinterPrintExprConstFetch(t *testing.T) {
1784 o := bytes.NewBufferString("")
1785
1786 p := printer.NewPrinter(o)
1787 p.Print(&expr.ConstFetch{
1788 Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}},
1789 })
1790
1791 expected := "null"
1792 actual := o.String()
1793
1794 if expected != actual {
1795 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1796 }
1797}
1798
1799func TestPrinterPrintEmpty(t *testing.T) {
1800 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…