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

Function TestPrinterPrintYieldFull

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

Source from the content-addressed store, hash-verified

2547}
2548
2549func TestPrinterPrintYieldFull(t *testing.T) {
2550 o := bytes.NewBufferString("")
2551
2552 p := printer.NewPrinter(o)
2553 p.Print(&expr.Yield{
2554 Key: &expr.Variable{
2555 VarName: &node.Identifier{Value: "k"},
2556 },
2557 Value: &expr.Variable{
2558 VarName: &node.Identifier{Value: "var"},
2559 },
2560 })
2561
2562 expected := `yield $k=>$var`
2563 actual := o.String()
2564
2565 if expected != actual {
2566 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2567 }
2568}
2569
2570// stmt
2571

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…