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

Function TestPrinterPrintStmtElseExpr

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

Source from the content-addressed store, hash-verified

3466}
3467
3468func TestPrinterPrintStmtElseExpr(t *testing.T) {
3469 o := bytes.NewBufferString("")
3470
3471 p := printer.NewPrinter(o)
3472 p.Print(&stmt.Else{
3473 Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}},
3474 })
3475
3476 expected := `else 'bar';`
3477 actual := o.String()
3478
3479 if expected != actual {
3480 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
3481 }
3482}
3483
3484func TestPrinterPrintStmtElseNop(t *testing.T) {
3485 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…