提交 ab8cdddb 编写于 作者: N naoto

8214770: java/time/test/java/time/format/TestNonIsoFormatter.java failed in non-english locales.

Reviewed-by: lancea, bpb
上级 e64e353e
...@@ -190,7 +190,7 @@ public class TestNonIsoFormatter { ...@@ -190,7 +190,7 @@ public class TestNonIsoFormatter {
String mdStr = "-01-01"; String mdStr = "-01-01";
DateTimeFormatter dtf = new DateTimeFormatterBuilder() DateTimeFormatter dtf = new DateTimeFormatterBuilder()
.appendPattern("GGGG y-M-d") .appendPattern("GGGG y-M-d")
.toFormatter() .toFormatter(Locale.ROOT)
.withChronology(chrono); .withChronology(chrono);
DateTimeFormatter dtfLenient = dtf.withResolverStyle(ResolverStyle.LENIENT); DateTimeFormatter dtfLenient = dtf.withResolverStyle(ResolverStyle.LENIENT);
assertEquals(LocalDate.parse(lenient+mdStr, dtfLenient), LocalDate.parse(strict+mdStr, dtf)); assertEquals(LocalDate.parse(lenient+mdStr, dtfLenient), LocalDate.parse(strict+mdStr, dtf));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册