(t *testing.T)
| 1515 | } |
| 1516 | |
| 1517 | func TestPrinterPrintExprArrayItemWithKey(t *testing.T) { |
| 1518 | o := bytes.NewBufferString("") |
| 1519 | |
| 1520 | p := printer.NewPrinter(o) |
| 1521 | p.Print(&expr.ArrayItem{ |
| 1522 | Key: &scalar.String{Value: "'Hello'"}, |
| 1523 | Val: &expr.Variable{ |
| 1524 | VarName: &node.Identifier{Value: "world"}, |
| 1525 | }, |
| 1526 | }) |
| 1527 | |
| 1528 | expected := `'Hello'=>$world` |
| 1529 | actual := o.String() |
| 1530 | |
| 1531 | if expected != actual { |
| 1532 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1533 | } |
| 1534 | } |
| 1535 | |
| 1536 | func TestPrinterPrintExprArrayItem(t *testing.T) { |
| 1537 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…