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

Function TestPrinterPrintExit

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

Source from the content-addressed store, hash-verified

1851}
1852
1853func TestPrinterPrintExit(t *testing.T) {
1854 o := bytes.NewBufferString("")
1855
1856 p := printer.NewPrinter(o)
1857 p.Print(&expr.Exit{
1858 Die: false,
1859 Expr: &expr.Variable{
1860 VarName: &node.Identifier{Value: "var"},
1861 },
1862 })
1863
1864 expected := `exit $var`
1865 actual := o.String()
1866
1867 if expected != actual {
1868 t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual)
1869 }
1870}
1871
1872func TestPrinterPrintDie(t *testing.T) {
1873 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…