diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java index 2ea83fde8..fb1b82f0e 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java @@ -94,4 +94,21 @@ public class TestHSSFRow assertEquals(2, row.getFirstCellNum()); assertEquals(5, row.getLastCellNum()); } + + public void testRemoveCell() + { + HSSFWorkbook workbook = new HSSFWorkbook(); + HSSFSheet sheet = workbook.createSheet(); + HSSFRow row = sheet.createRow((short) 0); + assertEquals(-1, row.getLastCellNum()); + row.createCell((short)1); + assertEquals(1, row.getLastCellNum()); + row.createCell((short)3); + assertEquals(3, row.getLastCellNum()); + row.removeCell(row.getCell((short)3)); + assertEquals(1, row.getLastCellNum()); + row.removeCell(row.getCell((short)1)); + assertEquals(-1, row.getLastCellNum()); + + } }