Skip to content

Commit 0df6a68

Browse files
committed
test: add empty string cases
1 parent 2f607c8 commit 0df6a68

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/test/java/org/apache/datasketches/tuple/strings/AosSketchCrossLanguageTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,18 @@ public void generateBinariesForCompatibilityTestingUnicodeStrings() throws IOExc
9595

9696
Files.newOutputStream(javaPath.resolve("aos_unicode_java.sk")).write(sk.compact().toByteArray());
9797
}
98+
99+
@Test(groups = {GENERATE_JAVA_FILES})
100+
public void generateBinariesForCompatibilityTestingEmptyStrings() throws IOException {
101+
ArrayOfStringsTupleSketch sk = new ArrayOfStringsTupleSketch();
102+
103+
sk.update(new String[]{""}, new String[]{"empty_key_value"});
104+
sk.update(new String[]{"empty_value_key"}, new String[]{""});
105+
sk.update(new String[]{"", ""}, new String[]{"", ""});
106+
107+
assertFalse(sk.isEmpty());
108+
assertEquals(sk.getRetainedEntries(), 3);
109+
110+
Files.newOutputStream(javaPath.resolve("aos_empty_strings_java.sk")).write(sk.compact().toByteArray());
111+
}
98112
}

0 commit comments

Comments
 (0)