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


##########
src/mango/src/mango_selector.erl:
##########
@@ -1070,12 +1073,18 @@ check_beginswith(Field, Prefix) ->
 match_beginswith_test() ->
     % matching
     ?assertEqual(true, check_beginswith(<<"_id">>, <<"f">>)),
-    % no match (user_id is not a binary string)
+    % no match (user_id field in the test doc contains an integer)
     ?assertEqual(false, check_beginswith(<<"user_id">>, <<"f">>)),
     % invalid (prefix is not a binary string)
     ?assertThrow(
         {mango_error, mango_selector, {invalid_operator, <<"$beginsWith">>}},
         check_beginswith(<<"user_id">>, 1)
+    ),
+    % invalid (prefix is not a utf8 string)
+    InvalidArg = <<32#FFFFF>>,

Review Comment:
   A tiny nit: this would just be `<<16#EF>>` as we're creating a base 32 
larger integer, but only the last byte is used from it.
   
   ```erlang
    <<16#EF>> =:= <<32#FFFFF>>.
   true
   ```



-- 
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: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to