Skip to content

Commit 702a638

Browse files
committed
add test to ensure BigInteger[] can be converted back to long[] as well
1 parent 24035e6 commit 702a638

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clickhouse-client/src/test/java/com/clickhouse/client/data/array/ClickHouseLongArrayValueTest.java

+8
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,12 @@ public void testConvertToBigInteger() throws Exception {
1414
Assert.assertArrayEquals(v.asArray(BigInteger.class),
1515
new BigInteger[] { BigInteger.ONE, new BigInteger("9223372036854775808") });
1616
}
17+
18+
@Test(groups = { "unit" })
19+
public void testConvertFromBigInteger() throws Exception {
20+
ClickHouseLongArrayValue v = ClickHouseLongArrayValue.ofEmpty();
21+
Assert.assertArrayEquals(v.getValue(), new long[0]);
22+
v.update(new BigInteger[] { BigInteger.ONE, new BigInteger("9223372036854775808") });
23+
Assert.assertArrayEquals(v.getValue(), new long[] { 1L, -9223372036854775808L });
24+
}
1725
}

0 commit comments

Comments
 (0)