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

Function TestPrinterPrintStmtBreak

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

Source from the content-addressed store, hash-verified

2837}
2838
2839func TestPrinterPrintStmtBreak(t *testing.T) {
2840 o := bytes.NewBufferString("")
2841
2842 p := printer.NewPrinter(o)
2843 p.Print(&stmt.Break{
2844 Expr: &scalar.Lnumber{
2845 Value: "1",
2846 },
2847 })
2848
2849 expected := "break 1;"
2850 actual := o.String()
2851
2852 if expected != actual {
2853 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
2854 }
2855}
2856
2857func TestPrinterPrintStmtCase(t *testing.T) {
2858 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…