jdeppe-pivotal commented on a change in pull request #6447:
URL: https://github.com/apache/geode/pull/6447#discussion_r629433722
##########
File path:
geode-apis-compatible-with-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/key/AbstractKeysIntegrationTest.java
##########
@@ -54,68 +55,71 @@ public void errors_givenWrongNumberOfArguments() {
@Test
public void givenSplat_withASCIIdata_returnsExpectedMatches() {
- jedis.set("string1", "v1");
- jedis.sadd("set1", "member1");
- jedis.hset("hash1", "key1", "field1");
- assertThat(jedis.keys("*")).containsExactlyInAnyOrder("string1", "set1",
"hash1");
- assertThat(jedis.keys("s*")).containsExactlyInAnyOrder("string1", "set1");
- assertThat(jedis.keys("h*")).containsExactlyInAnyOrder("hash1");
- assertThat(jedis.keys("foo*")).isEmpty();
+ jedis.set("{K}string1", "v1");
+ jedis.sadd("{K}set1", "member1");
+ jedis.hset("{K}hash1", "key1", "field1");
+ assertThat(jedis.keys("{K}*")).containsExactlyInAnyOrder("{K}string1",
"{K}set1", "{K}hash1");
+ assertThat(jedis.keys("{K}s*")).containsExactlyInAnyOrder("{K}string1",
"{K}set1");
+ assertThat(jedis.keys("{K}h*")).containsExactlyInAnyOrder("{K}hash1");
+ assertThat(jedis.keys("{K}foo*")).isEmpty();
}
@Test
public void givenSplat_withBinaryData_returnsExpectedMatches() {
byte[] stringKey =
- new byte[] {(byte) 0xac, (byte) 0xed, 0, 4, 0, 5, 's', 't', 'r', 'i',
'n', 'g', '1'};
+ new byte[] {'{', 1, '}', (byte) 0xac, (byte) 0xed, 0, 4, 0, 5, 's',
't', 'r', 'i', 'n', 'g',
+ '1'};
byte[] value = new byte[] {'v', '1'};
jedis.set(stringKey, value);
- byte[] setKey = new byte[] {(byte) 0xac, (byte) 0xed, 0, 4, 0, 5, 's',
'e', 't', '1'};
+ byte[] setKey =
+ new byte[] {'{', 1, '}', (byte) 0xac, (byte) 0xed, 0, 4, 0, 5, 's',
'e', 't', '1'};
byte[] member = new byte[] {'m', '1'};
jedis.sadd(setKey, member);
- byte[] hashKey = new byte[] {(byte) 0xac, (byte) 0xed, 0, 4, 0, 5, 'h',
'a', 's', 'h', '1'};
- byte[] key = new byte[] {'k', 'e', 'y', '1'};
+ byte[] hashKey =
+ new byte[] {'{', 1, '}', (byte) 0xac, (byte) 0xed, 0, 4, 0, 5, 'h',
'a', 's', 'h', '1'};
+ byte[] key = new byte[] {'{', 1, '}', 'k', 'e', 'y', '1'};
jedis.hset(hashKey, key, value);
assertThat(jedis.exists(stringKey));
assertThat(jedis.exists(setKey));
assertThat(jedis.exists(hashKey));
Review comment:
Fixed. Well spotted!
--
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]