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

Function TestPrinterPrintStmtCaseEmpty

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

Source from the content-addressed store, hash-verified

2878}
2879
2880func TestPrinterPrintStmtCaseEmpty(t *testing.T) {
2881 o := bytes.NewBufferString("")
2882
2883 p := printer.NewPrinter(o)
2884 p.Print(&stmt.Case{
2885 Cond: &expr.Variable{
2886 VarName: &node.Identifier{Value: "a"},
2887 },
2888 Stmts: []node.Node{},
2889 })
2890
2891 expected := "case $a:"
2892 actual := o.String()
2893
2894 if expected != actual {
2895 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2896 }
2897}
2898
2899func TestPrinterPrintStmtCatch(t *testing.T) {
2900 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…