summaryrefslogtreecommitdiff
path: root/src/mango
diff options
context:
space:
mode:
authorGabor Pali <gabor.pali@ibm.com>2023-03-22 20:23:02 +0100
committerNick Vatamaniuc <nickva@users.noreply.github.com>2023-04-18 23:51:32 -0400
commit3351a2647775050939947ec758dca7001a440d50 (patch)
tree07864e13c4e4c15f95e42456c29af10c5737a861 /src/mango
parent42deb8471dd3dbea0c88f65b8bc34ab28211148b (diff)
downloadcouchdb-3351a2647775050939947ec758dca7001a440d50.tar.gz
mango: increase coverage of the `choose_best_index/1` test
Diffstat (limited to 'src/mango')
-rw-r--r--src/mango/src/mango_cursor_view.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mango/src/mango_cursor_view.erl b/src/mango/src/mango_cursor_view.erl
index 80b7fe205..9abb5cb66 100644
--- a/src/mango/src/mango_cursor_view.erl
+++ b/src/mango/src/mango_cursor_view.erl
@@ -742,13 +742,20 @@ choose_best_index_with_singleton_test() ->
%% - choose the index with the lowest difference between its prefix and field ranges
choose_best_index_lowest_difference_test() ->
- IndexRanges =
+ IndexRanges1 =
[
{index1, ranges1, 3},
{index2, ranges2, 2},
{index3, ranges3, 1}
],
- ?assertEqual({index3, ranges3}, choose_best_index(IndexRanges)).
+ ?assertEqual({index3, ranges3}, choose_best_index(IndexRanges1)),
+ IndexRanges2 =
+ [
+ {index1, ranges1, 3},
+ {index2, ranges2, 1},
+ {index3, ranges3, 2}
+ ],
+ ?assertEqual({index2, ranges2}, choose_best_index(IndexRanges2)).
%% - if that is equal, choose the index with the least number of fields in the index
choose_best_index_least_number_of_fields_test() ->