Skip to content

Commit 4858eea

Browse files
sazzad16gkorland
andauthored
Non-arrays get cleared too (#65)
* Non-arrays get cleared too Co-authored-by: Guy Korland <gkorland@gmail.com>
1 parent 3eda155 commit 4858eea

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/test/java/com/redislabs/modules/rejson/ClientTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,15 @@ public void clearArray() {
417417

418418
assertEquals(1L, client.clear("foobar", arrPath));
419419
assertEquals(Long.valueOf(0L), client.arrLen("foobar", arrPath));
420-
421-
// ignore non-array
420+
}
421+
422+
@Test
423+
public void clearString() {
424+
client.set("foobar", new FooBarObject(), Path.ROOT_PATH);
425+
422426
Path strPath = Path.of("foo");
423-
assertEquals(0L, client.clear("foobar", strPath));
424-
assertEquals("bar", client.get("foobar", String.class, strPath));
427+
assertEquals(1L, client.clear("foobar", strPath));
428+
assertEquals("", client.get("foobar", String.class, strPath));
425429
}
426430

427431
@Test

0 commit comments

Comments
 (0)