Skip to content

Commit

Permalink
add new space in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
UrielCh committed Mar 14, 2024
1 parent 6e8eeb8 commit c30be8e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ public static Date convertToDate(Object obj) {
obj = ((String) obj)
.replace("p.m.", "pm")
.replace("a.m.", "am"); // added on 1st of may 2021
StringTokenizer st = new StringTokenizer((String) obj, " -/:,.+年月日曜時分秒");
// contains 2 differents spaces
StringTokenizer st = new StringTokenizer((String) obj, "  -/:,.+年月日曜時分秒");
// 2012年1月23日月曜日 13時42分59秒 中央ヨーロッパ標準時
String s1 = "";
if (!st.hasMoreTokens())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package net.minidev.asm;

import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;

public class TestDateConvertCustom {
/**
* some JAVA version use aternative space.
* @throws Exception
*/
@Test
public void testCANADACustom() throws Exception {
String testDate = "Jan 23, 2012, 1:42:59 PM";
ConvertDate.convertToDate(testDate);
assertTrue(true, "parse " + testDate + " do not crash");
}
}

0 comments on commit c30be8e

Please sign in to comment.