[
https://issues.apache.org/jira/browse/GEODE-8864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17286563#comment-17286563
]
ASF GitHub Bot commented on GEODE-8864:
---------------------------------------
jhutchison commented on a change in pull request #5954:
URL: https://github.com/apache/geode/pull/5954#discussion_r578542549
##########
File path:
geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHScanIntegrationTest.java
##########
@@ -174,13 +211,62 @@ public void givenNonexistentKey_returnsEmptyArray() {
assertThat(result.getResult()).isEmpty();
}
+ @Test
+ public void givenNegativeCursor_returnsEntriesUsingAbsoluteValueOfCursor() {
+ Map<String, String> entryMap = new HashMap<>();
+ entryMap.put("1", "yellow");
+ entryMap.put("2", "green");
+ entryMap.put("3", "orange");
+ jedis.hmset("colors", entryMap);
+
+ String cursor = "-100";
+ ScanResult<Map.Entry<String, String>> result;
+ List<Map.Entry<String, String>> allEntries = new ArrayList<>();
+
+ do {
+ result = jedis.hscan("colors", cursor);
+ allEntries.addAll(result.getResult());
+ cursor = result.getCursor();
+ } while (!result.isCompleteIteration());
+
+ assertThat(allEntries).hasSize(3);
+ assertThat(new HashSet<>(allEntries)).isEqualTo(entryMap.entrySet());
+ }
+
+ @Test
+ public void givenCursorGreaterThanUnsignedLongCapacity_returnsCursorError() {
+ assertThatThrownBy(() -> jedis.hscan("a", "18446744073709551616"))
+ .hasMessageContaining(ERROR_CURSOR);
+ }
+
+ @Test
+ public void
givenNegativeCursorGreaterThanUnsignedLongCapacity_returnsCursorError() {
Review comment:
done
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> finish implementation of Redis HScan Command
> --------------------------------------------
>
> Key: GEODE-8864
> URL: https://issues.apache.org/jira/browse/GEODE-8864
> Project: Geode
> Issue Type: New Feature
> Components: redis
> Reporter: John Hutchison
> Priority: Major
> Labels: pull-request-available
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)