mraible commented on code in PR #222:
URL: https://github.com/apache/roller/pull/222#discussion_r4402289707


##########
app/src/test/java/org/apache/roller/weblogger/business/UserTest.java:
##########
@@ -149,6 +149,18 @@ public void testUserLookups() throws Exception {
         user = users2.get(0);
         assertNotNull(user);
         assertEquals(testUser.getUserName(), user.getUserName());
+
+        // '%' and '_' in the search text match only themselves
+        assertEquals(0, mgr.getUsersStartingWith("%", Boolean.TRUE, 0, 
10).size());
+        assertEquals(0, mgr.getUsersStartingWith("us_r", Boolean.TRUE, 0, 
10).size());

Review Comment:
   These `"us_r"` checks pass even without the `_` escaping, because neither 
the test user name (`junit_userTestUser`) nor its email starts with "us" + any 
character + "r". I removed only the `_` escape from `likePrefix` and `UserTest` 
still passed. Something like `getUsersStartingWith("j_nit", Boolean.TRUE, 0, 
10)` returning 0 would catch it, since an unescaped `_` matches the "u".



-- 
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