(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func TestPrinterPrintNullable(t *testing.T) { |
| 172 | o := bytes.NewBufferString("") |
| 173 | |
| 174 | p := printer.NewPrinter(o) |
| 175 | p.Print(&node.Nullable{ |
| 176 | Expr: &node.Parameter{ |
| 177 | ByRef: true, |
| 178 | Variadic: false, |
| 179 | VariableType: &name.FullyQualified{ |
| 180 | Parts: []node.Node{ |
| 181 | &name.NamePart{ |
| 182 | Value: "Foo", |
| 183 | }, |
| 184 | }, |
| 185 | }, |
| 186 | Variable: &expr.Variable{ |
| 187 | VarName: &node.Identifier{ |
| 188 | Value: "var", |
| 189 | }, |
| 190 | }, |
| 191 | DefaultValue: &scalar.String{ |
| 192 | Value: "'default'", |
| 193 | }, |
| 194 | }, |
| 195 | }) |
| 196 | |
| 197 | expected := "?\\Foo&$var='default'" |
| 198 | actual := o.String() |
| 199 | |
| 200 | if expected != actual { |
| 201 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | func TestPrinterPrintArgument(t *testing.T) { |
| 206 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…