summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Šulc <fordfrog@gentoo.org>2008-02-20 19:22:50 +0000
committerMiroslav Šulc <fordfrog@gentoo.org>2008-02-20 19:22:50 +0000
commit7fdad1f170b60652b7086c97f622b964784998f5 (patch)
treea60bab26ec68386c263b7ae17bf778253df9c0c6 /dev-java/poi/files
parentadd ESVN_SWITCH_CMD and use svn switch as necessary (diff)
downloadgentoo-2-7fdad1f170b60652b7086c97f622b964784998f5.tar.gz
gentoo-2-7fdad1f170b60652b7086c97f622b964784998f5.tar.bz2
gentoo-2-7fdad1f170b60652b7086c97f622b964784998f5.zip
Fixed error in tests caused by applying patch that fixes determination of date/time formats in cells
(Portage version: 2.1.4.4)
Diffstat (limited to 'dev-java/poi/files')
-rw-r--r--dev-java/poi/files/poi-3.0.2-isADateFormatTest.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/dev-java/poi/files/poi-3.0.2-isADateFormatTest.patch b/dev-java/poi/files/poi-3.0.2-isADateFormatTest.patch
new file mode 100644
index 000000000000..b21c1d64316b
--- /dev/null
+++ b/dev-java/poi/files/poi-3.0.2-isADateFormatTest.patch
@@ -0,0 +1,45 @@
+--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDateUtil.java 2007/12/04 17:06:57 601004
++++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDateUtil.java 2008/02/07 12:39:12 619382
+@@ -228,6 +228,7 @@
+ "yyyy-mm-dd", "yyyy/mm/dd", "yy/mm/dd", "yy/mmm/dd",
+ "dd/mm/yy", "dd/mm/yyyy", "dd/mmm/yy",
+ "dd-mm-yy", "dd-mm-yyyy",
++ "DD-MM-YY", "DD-mm-YYYY",
+ "dd\\-mm\\-yy", // Sometimes escaped
+
+ // These crazy ones are valid
+@@ -242,15 +243,33 @@
+ assertTrue( HSSFDateUtil.isADateFormat(formatId, formats[i]) );
+ }
+
++ // Then time based ones too
++ formats = new String[] {
++ "yyyy-mm-dd hh:mm:ss", "yyyy/mm/dd HH:MM:SS",
++ "mm/dd HH:MM", "yy/mmm/dd SS",
++ };
++ for(int i=0; i<formats.length; i++) {
++ assertTrue( HSSFDateUtil.isADateFormat(formatId, formats[i]) );
++ }
++
+ // Then invalid ones
+ formats = new String[] {
+- "yyyy:mm:dd",
++ "yyyy*mm*dd",
+ "0.0", "0.000",
+ "0%", "0.0%",
+ "", null
+ };
+ for(int i=0; i<formats.length; i++) {
+ assertFalse( HSSFDateUtil.isADateFormat(formatId, formats[i]) );
++ }
++
++ // And these are ones we probably shouldn't allow,
++ // but would need a better regexp
++ formats = new String[] {
++ "yyyy:mm:dd",
++ };
++ for(int i=0; i<formats.length; i++) {
++ // assertFalse( HSSFDateUtil.isADateFormat(formatId, formats[i]) );
+ }
+ }
+