aboutsummaryrefslogtreecommitdiffstats
path: root/poi/src/test/java
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2023-11-08 13:41:53 +0000
committerPJ Fanning <fanningpj@apache.org>2023-11-08 13:41:53 +0000
commit8819952b2f7210d4201a1b1d75d420abc67d8c2c (patch)
treed8296a8a2eee2a2b02da2f70331b4e58ebe3f35b /poi/src/test/java
parente95a4d84d094763f706ff7e5585a5374b1638013 (diff)
downloadpoi-8819952b2f7210d4201a1b1d75d420abc67d8c2c.tar.gz
poi-8819952b2f7210d4201a1b1d75d420abc67d8c2c.zip
[bug-68094] try to improve cell width derivation by not rounding
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913676 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi/src/test/java')
-rw-r--r--poi/src/test/java/org/apache/poi/ss/util/TestSheetUtil.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/poi/src/test/java/org/apache/poi/ss/util/TestSheetUtil.java b/poi/src/test/java/org/apache/poi/ss/util/TestSheetUtil.java
index 288ded538d..b63460596c 100644
--- a/poi/src/test/java/org/apache/poi/ss/util/TestSheetUtil.java
+++ b/poi/src/test/java/org/apache/poi/ss/util/TestSheetUtil.java
@@ -108,6 +108,9 @@ final class TestSheetUtil {
// no contents: cell.setCellValue("sometext");
assertEquals(-1.0, SheetUtil.getCellWidth(cell, 1, null, true), 0.01);
+ assertEquals(-1.0, SheetUtil.getCellWidth(cell, 1.0f, null, true), 0.01);
+
+ assertEquals(-1.0, SheetUtil.getCellWidth(cell, 1.5f, null, true), 0.01);
}
}
@@ -120,7 +123,9 @@ final class TestSheetUtil {
cell.setCellValue("sometext");
- assertTrue(SheetUtil.getCellWidth(cell, 1, null, true) > 0);
+ final double width = SheetUtil.getCellWidth(cell, 1.0f, null, true);
+ assertTrue(width > 0);
+ assertEquals(width, SheetUtil.getCellWidth(cell, 1, null, true));
}
}