MCPcopy
hub / github.com/pelletier/go-toml / compareIterator

Function compareIterator

unstable/parser_test.go:178–198  ·  view source on GitHub ↗
(t *testing.T, expected []astNode, actual Iterator)

Source from the content-addressed store, hash-verified

176}
177
178func 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
201func TestParser_AST(t *testing.T) {

Callers 1

compareNodeFunction · 0.85

Calls 4

compareNodeFunction · 0.85
NodeMethod · 0.80
FatalMethod · 0.80
NextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…