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

Function TestPrinterPrintUse

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

Source from the content-addressed store, hash-verified

4450}
4451
4452func TestPrinterPrintUse(t *testing.T) {
4453 o := bytes.NewBufferString("")
4454
4455 p := printer.NewPrinter(o)
4456 p.Print(&stmt.Use{
4457 UseType: &node.Identifier{Value: "function"},
4458 Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
4459 Alias: &node.Identifier{Value: "Bar"},
4460 })
4461
4462 expected := `function Foo as Bar`
4463 actual := o.String()
4464
4465 if expected != actual {
4466 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
4467 }
4468}
4469
4470func TestPrinterPrintWhileStmtList(t *testing.T) {
4471 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…