MCPcopy
hub / github.com/grafana/tempo / TestRowNumberNext

Function TestRowNumberNext

pkg/parquetquery/iters_test.go:56–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54}
55
56func TestRowNumberNext(t *testing.T) {
57 tr := EmptyRowNumber()
58 require.Equal(t, RowNumber{-1, -1, -1, -1, -1, -1, -1, -1}, tr)
59
60 steps := []struct {
61 repetitionLevel int
62 definitionLevel int
63 maxDefinitionLevel int
64 expected RowNumber
65 }{
66 // Name.Language.Country examples from the Dremel whitepaper
67 {0, 3, 3, RowNumber{0, 0, 0, 0, -1, -1, -1, -1}},
68 {2, 2, 3, RowNumber{0, 0, 1, -1, -1, -1, -1, -1}},
69 {1, 1, 3, RowNumber{0, 1, -1, -1, -1, -1, -1, -1}},
70 {1, 3, 3, RowNumber{0, 2, 0, 0, -1, -1, -1, -1}},
71 {0, 1, 3, RowNumber{1, 0, -1, -1, -1, -1, -1, -1}},
72 }
73
74 for _, step := range steps {
75 tr.Next(step.repetitionLevel, step.definitionLevel, step.maxDefinitionLevel)
76 require.Equal(t, step.expected, tr)
77 }
78}
79
80func TestCompareRowNumbers(t *testing.T) {
81 testCases := []struct {

Callers

nothing calls this directly

Calls 3

EmptyRowNumberFunction · 0.85
NextMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected