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

Function TestPrinterPrintStmtConstant

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

Source from the content-addressed store, hash-verified

3150}
3151
3152func TestPrinterPrintStmtConstant(t *testing.T) {
3153 o := bytes.NewBufferString("")
3154
3155 p := printer.NewPrinter(o)
3156 p.Print(&stmt.Constant{
3157 ConstantName: &node.Identifier{Value: "FOO"},
3158 Expr: &scalar.String{Value: "'BAR'"},
3159 })
3160
3161 expected := "FOO='BAR'"
3162 actual := o.String()
3163
3164 if expected != actual {
3165 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
3166 }
3167}
3168
3169func TestPrinterPrintStmtContinue(t *testing.T) {
3170 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…