mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix bug
This commit is contained in:
parent
86fb2a6c6f
commit
f2ae96af22
@ -99,7 +99,7 @@ public class DatePattern {
|
||||
*
|
||||
* @since 5.3.6
|
||||
*/
|
||||
public static final Pattern REGEX_NORM = Pattern.compile("\\d{4}-\\d{1,2}-\\d{1,2}(\\s\\d{1,2}:\\d{1,2}(:\\d{1,2})?)?(.\\d{1,6})?");
|
||||
public static final Pattern REGEX_NORM = Pattern.compile("\\d{4}-\\d{1,2}-\\d{1,2}(\\s\\d{1,2}:\\d{1,2}(:\\d{1,2})?(.\\d{1,6})?)?");
|
||||
|
||||
// region Normal
|
||||
//================================================== Normal ==================================================
|
||||
|
@ -16,6 +16,7 @@ import org.dromara.hutool.core.date.DateException;
|
||||
import org.dromara.hutool.core.date.DatePattern;
|
||||
import org.dromara.hutool.core.date.DateTime;
|
||||
import org.dromara.hutool.core.date.format.DefaultDateBasic;
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
|
||||
|
25
hutool-core/src/test/java/org/dromara/hutool/core/date/IssueI7QI6RTest.java
Executable file
25
hutool-core/src/test/java/org/dromara/hutool/core/date/IssueI7QI6RTest.java
Executable file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2023 looly(loolly@aliyun.com)
|
||||
* Hutool is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.core.date;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class IssueI7QI6RTest {
|
||||
|
||||
@Test
|
||||
void parseTest() {
|
||||
Assertions.assertThrows(DateException.class, ()-> DateUtil.parse("2023-8-4-1"));
|
||||
Assertions.assertThrows(DateException.class, ()-> DateUtil.parse("2023-8-4 1"));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user