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
5f23aa95f7
commit
07cf6736ae
@ -256,11 +256,17 @@ public final class TestCellRangeAddress extends TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void assertIntersects(CellRangeAddress regionA, CellRangeAddress regionB) {
|
private static void assertIntersects(CellRangeAddress regionA, CellRangeAddress regionB) {
|
||||||
assertTrue(regionA.intersects(regionB));
|
if (!(regionA.intersects(regionB) && regionB.intersects(regionA))) {
|
||||||
assertTrue(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) {
|
private static void assertNotIntersects(CellRangeAddress regionA, CellRangeAddress regionB) {
|
||||||
assertFalse(regionA.intersects(regionB));
|
if ((regionA.intersects(regionB) || regionB.intersects(regionA))) {
|
||||||
assertFalse(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
Block a user