(t *testing.T)
| 1838 | } |
| 1839 | |
| 1840 | func TestPrintShellExec(t *testing.T) { |
| 1841 | o := bytes.NewBufferString("") |
| 1842 | |
| 1843 | p := printer.NewPrettyPrinter(o, " ") |
| 1844 | p.Print(&expr.ShellExec{ |
| 1845 | Parts: []node.Node{ |
| 1846 | &scalar.EncapsedStringPart{Value: "hello "}, |
| 1847 | &expr.Variable{VarName: &node.Identifier{Value: "world"}}, |
| 1848 | &scalar.EncapsedStringPart{Value: "!"}, |
| 1849 | }, |
| 1850 | }) |
| 1851 | |
| 1852 | expected := "`hello {$world}!`" |
| 1853 | actual := o.String() |
| 1854 | |
| 1855 | if expected != actual { |
| 1856 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1857 | } |
| 1858 | } |
| 1859 | |
| 1860 | func TestPrintExprShortArray(t *testing.T) { |
| 1861 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…