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

Function TestPrintNamespace

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

Source from the content-addressed store, hash-verified

3489}
3490
3491func TestPrintNamespace(t *testing.T) {
3492 o := bytes.NewBufferString("")
3493
3494 p := printer.NewPrettyPrinter(o, " ")
3495 p.Print(&stmt.Namespace{
3496 NamespaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
3497 })
3498
3499 expected := `namespace Foo;`
3500 actual := o.String()
3501
3502 if expected != actual {
3503 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
3504 }
3505}
3506
3507func TestPrintNamespaceWithStmts(t *testing.T) {
3508 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…