Add disabled unit test for #64319

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1876225 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2020-04-07 09:46:32 +00:00
parent 3a6ebecc6f
commit 2fb30f7892
2 changed files with 28 additions and 0 deletions

View File

@ -45,5 +45,6 @@
<classpathentry kind="lib" path="lib/byte-buddy-1.10.1.jar"/>
<classpathentry kind="lib" path="lib/byte-buddy-agent-1.10.1.jar"/>
<classpathentry kind="lib" path="compile-lib/batik-all-1.12.jar"/>
<classpathentry kind="lib" path="lib/SparseBitSet-1.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -965,6 +965,33 @@ public class TestDataFormatter {
doFormatTestSequential(formatter1);
doFormatTestConcurrent(formatter1, formatter2);
}
/**
* Bug #64319
*
* A custom format string like TRUE shouldn't be E+
* A numeric format string like 0E0 shouldn't be E+
* A numeric format string like 0E+0 should be E+
*/
@Test
@Ignore("Bug #64319 is currently failing")
public void testWithEinFormat() throws Exception {
DataFormatter formatter = new DataFormatter();
assertEquals("TRUE", formatter.formatRawCellContents(1.0, 170,
"\"TRUE\";\"TRUE\";\"FALSE\""));
assertEquals("TRUE", formatter.formatRawCellContents(0.0, 170,
"\"TRUE\";\"TRUE\";\"FALSE\""));
assertEquals("FALSE", formatter.formatRawCellContents(-1.0, 170,
"\"TRUE\";\"TRUE\";\"FALSE\""));
assertEquals("1E+05", formatter.formatRawCellContents(1e05, 170,
"0E+00"));
assertEquals("1E+10", formatter.formatRawCellContents(1e10, 170,
"0E+00"));
assertEquals("1E5", formatter.formatRawCellContents(1e05, 170,
"0E0"));
assertEquals("1E10", formatter.formatRawCellContents(1e10, 170,
"0E0"));
}
private void doFormatTestSequential(DataFormatter formatter) {
for (int i = 0; i < 1_000; i++) {