Skip to content

Commit 5689bd2

Browse files
committed
review(R26): swap assertEquals arg order to (expected, actual)
R26 caught one assertEquals call at line 1139 in testZonemapConsolidatedCommitShape with reversed JUnit 5 argument order: `assertEquals(fragmentsIndexed, expectedFragments.size())`. JUnit's signature is `assertEquals(expected, actual, message)`, where the test author's known ground truth goes in the expected slot and the value-under-test in the actual slot. With the arguments swapped, a failure prints "expected: <SQL return> but was: <dataset fragment count>" — misleading operators who'd correlate the message against what they think the system should do, not against the SQL return. Swap to `assertEquals(expectedFragments.size(), (int) fragmentsIndexed)`. Reset clean counter to 0/10. Test count: 38 (unchanged), make lint passes, all green on 3.5/2.12.
1 parent 11342ca commit 5689bd2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lance-spark-base_2.12/src/test/java/org/lance/spark/update/BaseAddIndexTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,8 +1137,8 @@ public void testZonemapConsolidatedCommitShape() {
11371137
}
11381138
}
11391139
Assertions.assertEquals(
1140-
(int) fragmentsIndexed,
11411140
expectedFragments.size(),
1141+
(int) fragmentsIndexed,
11421142
"fragmentsIndexed return value must match the dataset's current fragment count");
11431143
// Without >=2 fragments the "single segment vs N segments" shape is indistinguishable
11441144
// from the distributed path's N=1 degenerate case.

0 commit comments

Comments
 (0)