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

Function TestPrintExprConstFetch

printer/pretty_printer_test.go:1435–1449  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1433}
1434
1435func TestPrintExprConstFetch(t *testing.T) {
1436 o := bytes.NewBufferString("")
1437
1438 p := printer.NewPrettyPrinter(o, " ")
1439 p.Print(&expr.ConstFetch{
1440 Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}},
1441 })
1442
1443 expected := "null"
1444 actual := o.String()
1445
1446 if expected != actual {
1447 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1448 }
1449}
1450
1451func TestPrintEmpty(t *testing.T) {
1452 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrettyPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…