Skip to content

Commit

Permalink
Added test for empty array for PGbit
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Jul 17, 2024
1 parent fce784a commit 1fdb455
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/java/com/pgvector/PGbitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ void testArrayConstructor() {
assertArrayEquals(new boolean[] {false, true, false, true, false, false, false, false, true}, vec.toArray());
}

void testEmptyArrayConstructor() {
PGbit vec = new PGbit(new boolean[] {});
assertEquals(0, vec.length());
assertArrayEquals(new byte[] {}, vec.toByteArray());
assertArrayEquals(new boolean[] {}, vec.toArray());
}

@Test
void testStringConstructor() throws SQLException {
PGbit vec = new PGbit("010100001");
Expand Down

0 comments on commit 1fdb455

Please sign in to comment.