(t *testing.T, expected []astNode, actual Iterator)
| 176 | } |
| 177 | |
| 178 | func compareIterator(t *testing.T, expected []astNode, actual Iterator) { |
| 179 | t.Helper() |
| 180 | idx := 0 |
| 181 | |
| 182 | for actual.Next() { |
| 183 | n := actual.Node() |
| 184 | |
| 185 | if idx >= len(expected) { |
| 186 | t.Fatal("extra child in actual tree") |
| 187 | } |
| 188 | e := expected[idx] |
| 189 | |
| 190 | compareNode(t, e, n) |
| 191 | |
| 192 | idx++ |
| 193 | } |
| 194 | |
| 195 | if idx < len(expected) { |
| 196 | t.Fatal("missing children in actual", "idx =", idx, "expected =", len(expected)) |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | //nolint:funlen |
| 201 | func TestParser_AST(t *testing.T) { |
no test coverage detected
searching dependent graphs…