(t *testing.T)
| 1889 | } |
| 1890 | |
| 1891 | func TestPrinterPrintFunctionCall(t *testing.T) { |
| 1892 | o := bytes.NewBufferString("") |
| 1893 | |
| 1894 | p := printer.NewPrinter(o) |
| 1895 | p.Print(&expr.FunctionCall{ |
| 1896 | Function: &expr.Variable{ |
| 1897 | VarName: &node.Identifier{Value: "var"}, |
| 1898 | }, |
| 1899 | ArgumentList: &node.ArgumentList{ |
| 1900 | Arguments: []node.Node{ |
| 1901 | &node.Argument{ |
| 1902 | IsReference: true, |
| 1903 | Expr: &expr.Variable{ |
| 1904 | VarName: &node.Identifier{Value: "a"}, |
| 1905 | }, |
| 1906 | }, |
| 1907 | &node.Argument{ |
| 1908 | Variadic: true, |
| 1909 | Expr: &expr.Variable{ |
| 1910 | VarName: &node.Identifier{Value: "b"}, |
| 1911 | }, |
| 1912 | }, |
| 1913 | &node.Argument{ |
| 1914 | Expr: &expr.Variable{ |
| 1915 | VarName: &node.Identifier{Value: "c"}, |
| 1916 | }, |
| 1917 | }, |
| 1918 | }, |
| 1919 | }, |
| 1920 | }) |
| 1921 | |
| 1922 | expected := `$var(&$a,...$b,$c)` |
| 1923 | actual := o.String() |
| 1924 | |
| 1925 | if expected != actual { |
| 1926 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1927 | } |
| 1928 | } |
| 1929 | |
| 1930 | func TestPrinterPrintInclude(t *testing.T) { |
| 1931 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…