expr
(t *testing.T)
| 1229 | // expr |
| 1230 | |
| 1231 | func TestPrintExprArrayDimFetch(t *testing.T) { |
| 1232 | o := bytes.NewBufferString("") |
| 1233 | |
| 1234 | p := printer.NewPrettyPrinter(o, " ") |
| 1235 | p.Print(&expr.ArrayDimFetch{ |
| 1236 | Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, |
| 1237 | Dim: &scalar.Lnumber{Value: "1"}, |
| 1238 | }) |
| 1239 | |
| 1240 | expected := `$var[1]` |
| 1241 | actual := o.String() |
| 1242 | |
| 1243 | if expected != actual { |
| 1244 | t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) |
| 1245 | } |
| 1246 | } |
| 1247 | |
| 1248 | func TestPrintExprArrayItemWithKey(t *testing.T) { |
| 1249 | o := bytes.NewBufferString("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…