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

Function TestPrinterPrintYield

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

Source from the content-addressed store, hash-verified

2529}
2530
2531func TestPrinterPrintYield(t *testing.T) {
2532 o := bytes.NewBufferString("")
2533
2534 p := printer.NewPrinter(o)
2535 p.Print(&expr.Yield{
2536 Value: &expr.Variable{
2537 VarName: &node.Identifier{Value: "var"},
2538 },
2539 })
2540
2541 expected := `yield $var`
2542 actual := o.String()
2543
2544 if expected != actual {
2545 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2546 }
2547}
2548
2549func TestPrinterPrintYieldFull(t *testing.T) {
2550 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…