Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tianchen92 committed Sep 25, 2019
1 parent 12e4aa2 commit 3d3d295
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,31 @@ public void testIntVectorEqualsWithNull() {
}
}

@Test
public void testEqualsWithTypeChange() {
try (final IntVector vector1 = new IntVector("intVector1", allocator);
final IntVector vector2 = new IntVector("intVector2", allocator);
final BigIntVector vector3 = new BigIntVector("bigIntVector", allocator)) {

vector1.allocateNew(2);
vector1.setValueCount(2);
vector2.allocateNew(2);
vector2.setValueCount(2);

vector1.setSafe(0, 1);
vector1.setSafe(1, 2);

vector2.setSafe(0, 1);
vector2.setSafe(1, 2);

RangeEqualsVisitor visitor = new RangeEqualsVisitor(vector1, vector2);
Range range = new Range(0, 0, 2);
assertTrue(vector1.accept(visitor, range));
// visitor left vector changed, will reset and check type again
assertFalse(vector3.accept(visitor, range));
}
}

@Test
public void testBaseFixedWidthVectorRangeEqual() {
try (final IntVector vector1 = new IntVector("int", allocator);
Expand Down

0 comments on commit 3d3d295

Please sign in to comment.