(t *testing.T)
| 1851 | } |
| 1852 | |
| 1853 | func 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 | |
| 1872 | func TestPrinterPrintDie(t *testing.T) { |
| 1873 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…