Skip to content

Commit

Permalink
Add a unit tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Kalmbach <[email protected]>
  • Loading branch information
joka921 committed Jan 15, 2025
1 parent dd79c0e commit 8813fba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/EngineTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,18 @@ TEST(OptionalJoin, specialOptionalJoinTwoColumns) {
IdTable expectedResult = makeIdTableFromVector(
{{4, 1, 2, U}, {2, 1, 3, 3}, {1, 1, 4, U}, {2, 2, 2, 4}, {1, 3, 1, 1}});

testOptionalJoin(a, b, jcls, expectedResult);
}
{
// Test a corner case that previously contained a bug.
IdTable a{makeIdTableFromVector({{4, U, 2}})};
IdTable b{makeIdTableFromVector({{3, 3, 1}})};
// Join a and b on the column pairs 1,2 and 2,1 (entries from columns 1 of
// a have to equal those of column 2 of b and vice versa).
JoinColumns jcls{{1, 2}, {2, 1}};

IdTable expectedResult = makeIdTableFromVector({{4, U, 2, U}});

testOptionalJoin(a, b, jcls, expectedResult);
}
}
Expand Down

0 comments on commit 8813fba

Please sign in to comment.