expr
(t *testing.T)
| 1496 | // expr |
| 1497 | |
| 1498 | func TestPrinterPrintExprArrayDimFetch(t *testing.T) { |
| 1499 | o := bytes.NewBufferString("") |
| 1500 | |
| 1501 | p := printer.NewPrinter(o) |
| 1502 | p.Print(&expr.ArrayDimFetch{ |
| 1503 | Variable: &expr.Variable{ |
| 1504 | VarName: &node.Identifier{Value: "var"}, |
| 1505 | }, |
| 1506 | Dim: &scalar.Lnumber{Value: "1"}, |
| 1507 | }) |
| 1508 | |
| 1509 | expected := `$var[1]` |
| 1510 | actual := o.String() |
| 1511 | |
| 1512 | if expected != actual { |
| 1513 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1514 | } |
| 1515 | } |
| 1516 | |
| 1517 | func TestPrinterPrintExprArrayItemWithKey(t *testing.T) { |
| 1518 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…