mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
add datetime test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1923881 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
dbaf834459
commit
5b12033b99
@ -1421,6 +1421,22 @@ public abstract class BaseTestCell {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testZeroDate() throws IOException {
|
||||
try (Workbook wb = _testDataProvider.createWorkbook()) {
|
||||
Cell cellA1 = getInstance(wb);
|
||||
cellA1.setCellValue(1.0);
|
||||
assertEquals(LocalDate.parse("1900-01-01"),
|
||||
cellA1.getLocalDateTimeCellValue().toLocalDate());
|
||||
|
||||
cellA1.setCellValue(0.0);
|
||||
// this value is not strictly correct but our time only support relies on this
|
||||
// time only means cells that have values with just times but no date parts
|
||||
assertEquals(LocalDate.parse("1899-12-31"),
|
||||
cellA1.getLocalDateTimeCellValue().toLocalDate());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
protected void setCellType_FORMULA_onAnArrayFormulaCell_doesNothing() throws IOException {
|
||||
try (Workbook wb = _testDataProvider.createWorkbook()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user