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

Function TestPrinterPrintStmtList

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

Source from the content-addressed store, hash-verified

4067}
4068
4069func TestPrinterPrintStmtList(t *testing.T) {
4070 o := bytes.NewBufferString("")
4071
4072 p := printer.NewPrinter(o)
4073 p.Print(&stmt.StmtList{
4074 Stmts: []node.Node{
4075 &stmt.Expression{Expr: &expr.Variable{
4076 VarName: &node.Identifier{Value: "a"},
4077 }},
4078 &stmt.Expression{Expr: &expr.Variable{
4079 VarName: &node.Identifier{Value: "b"},
4080 }},
4081 },
4082 })
4083
4084 expected := `{$a;$b;}`
4085 actual := o.String()
4086
4087 if expected != actual {
4088 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
4089 }
4090}
4091
4092func TestPrinterPrintStmtListNested(t *testing.T) {
4093 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…