Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit 0dfaddf

Browse files
committed
fix old typo
At some point in some other refactor, this option got removed from the function call it was supposed to be an option to. But actually that was... not correct either. Because if you look closely, it turns out that this test was completely broken; we were ignoring the results that were in the test, and using inline results, but that's okay, because we were also doing the wrong query for the second test, and ignoring the Field Options specified in the test... all fixed now.
1 parent bc07fb4 commit 0dfaddf

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

executor_test.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ func TestExecutor_ExecuteTopK(t *testing.T) {
17841784
fieldName: "fmutex",
17851785
fieldOptions: []pilosa.FieldOption{pilosa.OptFieldTypeMutex(pilosa.CacheTypeRanked, 10)},
17861786
bits: baseBits,
1787-
query: "TopK(f, k=2)",
1787+
query: "TopK(fmutex, k=2)",
17881788
result: []pilosa.Pair{
17891789
{ID: 10, Count: 3},
17901790
{ID: 0, Count: 2},
@@ -1796,18 +1796,11 @@ func TestExecutor_ExecuteTopK(t *testing.T) {
17961796

17971797
for _, tst := range tests {
17981798
t.Run(tst.fieldName, func(t *testing.T) {
1799-
pilosa.OptFieldTypeMutex(pilosa.CacheTypeRanked, 10)
1800-
c.CreateField(t, c.Idx(), pilosa.IndexOptions{TrackExistence: true}, tst.fieldName)
1799+
c.CreateField(t, c.Idx(), pilosa.IndexOptions{TrackExistence: true}, tst.fieldName, tst.fieldOptions...)
18011800
c.ImportBits(t, c.Idx(), tst.fieldName, tst.bits)
18021801
if result, err := c.GetNode(0).API.Query(context.Background(), &pilosa.QueryRequest{Index: c.Idx(), Query: tst.query}); err != nil {
18031802
t.Fatal(err)
1804-
} else if !reflect.DeepEqual(result.Results, []interface{}{&pilosa.PairsField{
1805-
Pairs: []pilosa.Pair{
1806-
{ID: 10, Count: 4},
1807-
{ID: 0, Count: 3},
1808-
},
1809-
Field: "f",
1810-
}}) {
1803+
} else if !reflect.DeepEqual(result.Results, []interface{}{&pilosa.PairsField{Pairs: tst.result, Field: tst.fieldName}}) {
18111804
t.Fatalf("unexpected result: %s", spew.Sdump(result))
18121805
}
18131806
})

0 commit comments

Comments
 (0)