(t *testing.T)
| 117 | } |
| 118 | |
| 119 | func TestArrayItems(t *testing.T) { |
| 120 | src := `<? array(1=>1, &$b,);` |
| 121 | |
| 122 | expected := &node.Root{ |
| 123 | Position: &position.Position{ |
| 124 | StartLine: 1, |
| 125 | EndLine: 1, |
| 126 | StartPos: 3, |
| 127 | EndPos: 21, |
| 128 | }, |
| 129 | Stmts: []node.Node{ |
| 130 | &stmt.Expression{ |
| 131 | Position: &position.Position{ |
| 132 | StartLine: 1, |
| 133 | EndLine: 1, |
| 134 | StartPos: 3, |
| 135 | EndPos: 21, |
| 136 | }, |
| 137 | Expr: &expr.Array{ |
| 138 | Position: &position.Position{ |
| 139 | StartLine: 1, |
| 140 | EndLine: 1, |
| 141 | StartPos: 3, |
| 142 | EndPos: 20, |
| 143 | }, |
| 144 | Items: []node.Node{ |
| 145 | &expr.ArrayItem{ |
| 146 | Position: &position.Position{ |
| 147 | StartLine: 1, |
| 148 | EndLine: 1, |
| 149 | StartPos: 9, |
| 150 | EndPos: 13, |
| 151 | }, |
| 152 | Key: &scalar.Lnumber{ |
| 153 | Position: &position.Position{ |
| 154 | StartLine: 1, |
| 155 | EndLine: 1, |
| 156 | StartPos: 9, |
| 157 | EndPos: 10, |
| 158 | }, |
| 159 | Value: "1", |
| 160 | }, |
| 161 | Val: &scalar.Lnumber{ |
| 162 | Position: &position.Position{ |
| 163 | StartLine: 1, |
| 164 | EndLine: 1, |
| 165 | StartPos: 12, |
| 166 | EndPos: 13, |
| 167 | }, |
| 168 | Value: "1", |
| 169 | }, |
| 170 | }, |
| 171 | &expr.ArrayItem{ |
| 172 | Position: &position.Position{ |
| 173 | StartLine: 1, |
| 174 | EndLine: 1, |
| 175 | StartPos: 15, |
| 176 | EndPos: 18, |
nothing calls this directly
no test coverage detected
searching dependent graphs…