Skip to content

Commit

Permalink
add test to ensure BigInteger[] can be converted back to long[] as well
Browse files Browse the repository at this point in the history
  • Loading branch information
zhicwu committed Jul 8, 2022
1 parent 24035e6 commit 702a638
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ public void testConvertToBigInteger() throws Exception {
Assert.assertArrayEquals(v.asArray(BigInteger.class),
new BigInteger[] { BigInteger.ONE, new BigInteger("9223372036854775808") });
}

@Test(groups = { "unit" })
public void testConvertFromBigInteger() throws Exception {
ClickHouseLongArrayValue v = ClickHouseLongArrayValue.ofEmpty();
Assert.assertArrayEquals(v.getValue(), new long[0]);
v.update(new BigInteger[] { BigInteger.ONE, new BigInteger("9223372036854775808") });
Assert.assertArrayEquals(v.getValue(), new long[] { 1L, -9223372036854775808L });
}
}

0 comments on commit 702a638

Please sign in to comment.