You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2022/05/23 14:46:53 UTC
svn commit: r1901178 - /poi/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestCeiling.java
Author: fanningpj
Date: Mon May 23 14:46:52 2022
New Revision: 1901178
URL: http://svn.apache.org/viewvc?rev=1901178&view=rev
Log:
add ceiling tests
Added:
poi/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestCeiling.java
- copied, changed from r1901177, poi/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFloor.java
Copied: poi/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestCeiling.java (from r1901177, poi/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFloor.java)
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestCeiling.java?p2=poi/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestCeiling.java&p1=poi/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFloor.java&r1=1901177&r2=1901178&rev=1901178&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestFloor.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/ss/formula/functions/TestCeiling.java Mon May 23 14:46:52 2022
@@ -33,11 +33,11 @@ import static org.apache.poi.ss.util.Uti
import static org.junit.jupiter.api.Assertions.assertThrows;
/**
- * Tests for Floor function
+ * Tests for Ceiling function
*/
-final class TestFloor {
+final class TestCeiling {
- //https://support.microsoft.com/en-us/office/floor-function-14bb497c-24f2-4e04-b327-b0b4de5a8886
+ //https://support.microsoft.com/en-us/office/ceiling-function-0a5cd7c8-0720-4f0a-bd2c-c943e510899f
@Test
void testMicrosoftExamples() throws IOException {
try (HSSFWorkbook wb = new HSSFWorkbook()) {
@@ -45,11 +45,11 @@ final class TestFloor {
HSSFRow row = sheet.createRow(0);
HSSFCell cell = row.createCell(0);
HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
- assertDouble(fe, cell, "FLOOR(3.7,2)", 2.0, 0.00000000000001);
- assertDouble(fe, cell, "FLOOR(-2.5,-2)", -2.0, 0.00000000000001);
- assertError(fe, cell, "FLOOR(2.5,-2)", FormulaError.NUM);
- assertDouble(fe, cell, "FLOOR(1.58,0.1)", 1.5, 0.00000000000001);
- assertDouble(fe, cell, "FLOOR(0.234,0.01)", 0.23, 0.00000000000001);
+ assertDouble(fe, cell, "CEILING(2.5, 1)", 3.0, 0.00000000000001);
+ assertDouble(fe, cell, "CEILING(-2.5, -2)", -4.0, 0.00000000000001);
+ assertDouble(fe, cell, "CEILING(-2.5, 2)", -2.0, 0.00000000000001);
+ assertDouble(fe, cell, "CEILING(1.5, 0.1)", 1.5, 0.00000000000001);
+ assertDouble(fe, cell, "CEILING(0.234, 0.01)", 0.24, 0.00000000000001);
}
}
@@ -61,7 +61,7 @@ final class TestFloor {
HSSFCell cell = row.createCell(0);
HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
assertThrows(FormulaParseException.class, () ->
- assertError(fe, cell, "FLOOR()", FormulaError.VALUE));
+ assertError(fe, cell, "CEILING()", FormulaError.VALUE));
}
}
@@ -72,7 +72,7 @@ final class TestFloor {
HSSFRow row = sheet.createRow(0);
HSSFCell cell = row.createCell(0);
HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
- assertError(fe, cell, "FLOOR(\"abc\", \"def\")", FormulaError.VALUE);
+ assertError(fe, cell, "CEILING(\"abc\", \"def\")", FormulaError.VALUE);
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org