(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func TestPrinterPrintParameter(t *testing.T) { |
| 142 | o := bytes.NewBufferString("") |
| 143 | |
| 144 | p := printer.NewPrinter(o) |
| 145 | p.Print(&node.Parameter{ |
| 146 | ByRef: false, |
| 147 | Variadic: true, |
| 148 | VariableType: &name.FullyQualified{ |
| 149 | Parts: []node.Node{ |
| 150 | &name.NamePart{ |
| 151 | Value: "Foo", |
| 152 | }, |
| 153 | }, |
| 154 | }, |
| 155 | Variable: &expr.Variable{ |
| 156 | VarName: &node.Identifier{Value: "var"}, |
| 157 | }, |
| 158 | DefaultValue: &scalar.String{ |
| 159 | Value: "'default'", |
| 160 | }, |
| 161 | }) |
| 162 | |
| 163 | expected := "\\Foo...$var='default'" |
| 164 | actual := o.String() |
| 165 | |
| 166 | if expected != actual { |
| 167 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | func TestPrinterPrintNullable(t *testing.T) { |
| 172 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…