(t *testing.T)
| 2324 | } |
| 2325 | |
| 2326 | func TestPrinterPrintShortList(t *testing.T) { |
| 2327 | o := bytes.NewBufferString("") |
| 2328 | |
| 2329 | p := printer.NewPrinter(o) |
| 2330 | p.Print(&expr.ShortList{ |
| 2331 | Items: []node.Node{ |
| 2332 | &expr.ArrayItem{ |
| 2333 | Val: &expr.Variable{ |
| 2334 | VarName: &node.Identifier{Value: "a"}, |
| 2335 | }, |
| 2336 | }, |
| 2337 | &expr.ArrayItem{ |
| 2338 | Val: &expr.List{ |
| 2339 | Items: []node.Node{ |
| 2340 | &expr.ArrayItem{ |
| 2341 | Val: &expr.Variable{ |
| 2342 | VarName: &node.Identifier{Value: "b"}, |
| 2343 | }, |
| 2344 | }, |
| 2345 | &expr.ArrayItem{ |
| 2346 | Val: &expr.Variable{ |
| 2347 | VarName: &node.Identifier{Value: "c"}, |
| 2348 | }, |
| 2349 | }, |
| 2350 | }, |
| 2351 | }, |
| 2352 | }, |
| 2353 | }, |
| 2354 | }) |
| 2355 | |
| 2356 | expected := `[$a,list($b,$c)]` |
| 2357 | actual := o.String() |
| 2358 | |
| 2359 | if expected != actual { |
| 2360 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 2361 | } |
| 2362 | } |
| 2363 | |
| 2364 | func TestPrinterPrintStaticCall(t *testing.T) { |
| 2365 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…