mirror of https://github.com/apache/poi.git
improve error message if CellRangeAddress intersection assertion fails
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1711597 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bc358fe708
commit
14736096ec
|
@ -256,11 +256,17 @@ public final class TestCellRangeAddress extends TestCase {
|
|||
}
|
||||
|
||||
private static void assertIntersects(CellRangeAddress regionA, CellRangeAddress regionB) {
|
||||
assertTrue(regionA.intersects(regionB));
|
||||
assertTrue(regionB.intersects(regionA));
|
||||
if (!(regionA.intersects(regionB) && regionB.intersects(regionA))) {
|
||||
final String A = regionA.formatAsString();
|
||||
final String B = regionB.formatAsString();
|
||||
fail("expected: regions "+A+" and "+B+" intersect");
|
||||
}
|
||||
}
|
||||
private static void assertNotIntersects(CellRangeAddress regionA, CellRangeAddress regionB) {
|
||||
assertFalse(regionA.intersects(regionB));
|
||||
assertFalse(regionB.intersects(regionA));
|
||||
if ((regionA.intersects(regionB) || regionB.intersects(regionA))) {
|
||||
final String A = regionA.formatAsString();
|
||||
final String B = regionB.formatAsString();
|
||||
fail("expected: regions "+A+" and "+B+" do not intersect");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue