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

Function TestPrinterPrintStmtDo_Expression

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

Source from the content-addressed store, hash-verified

3291}
3292
3293func TestPrinterPrintStmtDo_Expression(t *testing.T) {
3294 o := bytes.NewBufferString("")
3295
3296 p := printer.NewPrinter(o)
3297 p.Print(&stmt.Do{
3298 Cond: &scalar.Lnumber{Value: "1"},
3299 Stmt: &stmt.Expression{
3300 Expr: &expr.Variable{
3301 VarName: &node.Identifier{Value: "a"},
3302 },
3303 },
3304 })
3305
3306 expected := `do $a;while(1);`
3307 actual := o.String()
3308
3309 if expected != actual {
3310 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
3311 }
3312}
3313
3314func TestPrinterPrintStmtDo_StmtList(t *testing.T) {
3315 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…