nickva commented on code in PR #4512:
URL: https://github.com/apache/couchdb/pull/4512#discussion_r1167325227


##########
src/mango/src/mango_idx_view.erl:
##########
@@ -26,14 +26,20 @@
 
     indexable_fields/1,
     field_ranges/1,
-    field_ranges/2
+    field_ranges/2,
+
+    covers/2
 ]).
 
 -include_lib("couch/include/couch_db.hrl").
 -include("mango.hrl").
 -include("mango_idx.hrl").
 -include("mango_idx_view.hrl").
 
+-ifdef(TEST).
+-import(test_util, [as_selector/1]).
+-endif.
+

Review Comment:
   The idea is that we've been removing them over the years as they are  not 
that common and make it a bit confusing to see where the functions come from. 
Since the `as_selector` in the test is composed with 
`indexable_fields(as_selector(Selector))` a dozen times or so, we could create 
a smaller function like
   
   ```erlang
    indexable(Selector) ->
         indexable_fields(as_selector(Selector)).
   ```
   
   Then the test functions could be shorter. For instance:
   
   ```erlang
   indexable_fields_type_test() ->
       ?assertEqual([], indexable(#{<<"field">> => #{<<"$type">> => 
undefined}}).
   ```
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to