diff options
author | PJ Fanning <fanningpj@apache.org> | 2024-06-21 20:03:50 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2024-06-21 20:03:50 +0000 |
commit | 461691ef0e69da8cc0e750b17ce8aaf1c263d89e (patch) | |
tree | 30480dd3989452bbaf338f16feda876df7ca23bc | |
parent | 2a47c185c6b23df472b50130d0c3111dfc0d0ba9 (diff) | |
download | poi-461691ef0e69da8cc0e750b17ce8aaf1c263d89e.tar.gz poi-461691ef0e69da8cc0e750b17ce8aaf1c263d89e.zip |
add test related to bug-69147
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1918499 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | poi/src/test/java/org/apache/poi/ss/formula/functions/TestText.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestText.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestText.java index 329037df75..8a7dab1cb6 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestText.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestText.java @@ -23,6 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.text.DateFormatSymbols; import java.text.DecimalFormatSymbols; import java.text.SimpleDateFormat; +import java.time.LocalDate; import java.util.Arrays; import java.util.List; import java.util.TimeZone; @@ -33,6 +34,7 @@ import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.StringEval; import org.apache.poi.ss.formula.eval.ValueEval; +import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.util.LocaleUtil; import org.junit.jupiter.api.Test; @@ -278,6 +280,12 @@ final class TestText { testText(BoolEval.FALSE, new StringEval("#0.000"), BoolEval.FALSE.getStringValue()); } + @Test + void testTextMMM() { + LocalDate ld = LocalDate.parse("2022-02-28"); + testText(new NumberEval(DateUtil.getExcelDate(ld)), new StringEval("MMM"), "Feb"); + } + private void testText(ValueEval valueArg, ValueEval formatArg, String expectedResult) { ValueEval[] args = { valueArg, formatArg }; ValueEval result = TextFunction.TEXT.evaluate(args, -1, -1); |