You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2014/07/30 21:02:09 UTC
svn commit: r1614741 -
/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java
Author: nick
Date: Wed Jul 30 19:02:09 2014
New Revision: 1614741
URL: http://svn.apache.org/r1614741
Log:
Unit test to show that bug #53494 has already been fixed
Modified:
poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java
Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java?rev=1614741&r1=1614740&r2=1614741&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDataFormatter.java Wed Jul 30 19:02:09 2014
@@ -510,6 +510,32 @@ public class TestDataFormatter extends T
}
/**
+ * While we don't currently support using a locale code at
+ * the start of a format string to format it differently, we
+ * should at least handle it as it if wasn't there
+ */
+ public void testDatesWithLocales() {
+ DataFormatter dfUS = new DataFormatter(Locale.US, true);
+
+ String dateFormatEnglish = "[$-409]mmmm dd yyyy h:mm AM/PM";
+ String dateFormatChinese = "[$-804]mmmm dd yyyy h:mm AM/PM";
+
+ // Check we format the English one correctly
+ double date = 26995.477777777778;
+ assertEquals(
+ "November 27 1973 11:28 AM",
+ dfUS.formatRawCellContents(date, -1, dateFormatEnglish)
+ );
+
+ // Check that, in the absence of locale support, we handle
+ // the Chinese one the same as the English one
+ assertEquals(
+ "November 27 1973 11:28 AM",
+ dfUS.formatRawCellContents(date, -1, dateFormatChinese)
+ );
+ }
+
+ /**
* TODO Fix these so that they work
*/
public void DISABLEDtestCustomFormats() {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org