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

Function TestPrintScalarString

printer/pretty_printer_test.go:317–329  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

315}
316
317func TestPrintScalarString(t *testing.T) {
318 o := bytes.NewBufferString("")
319
320 p := printer.NewPrettyPrinter(o, " ")
321 p.Print(&scalar.String{Value: "'hello world'"})
322
323 expected := `'hello world'`
324 actual := o.String()
325
326 if expected != actual {
327 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
328 }
329}
330
331func TestPrintScalarEncapsedStringPart(t *testing.T) {
332 o := bytes.NewBufferString("")

Callers

nothing calls this directly

Calls 3

PrintMethod · 0.95
NewPrettyPrinterFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…