提交 36fbe17a 编写于 作者: R rriggs

8024612: java/time/tck/java/time/format/TCKDateTimeFormatters.java failed

Summary: The test should be using the Locale.Category.FORMAT to verify the test data
Reviewed-by: lancea
上级 1caca411
...@@ -126,9 +126,10 @@ public class TCKDateTimeFormatters { ...@@ -126,9 +126,10 @@ public class TCKDateTimeFormatters {
@Test @Test
public void test_pattern_String() { public void test_pattern_String() {
DateTimeFormatter test = DateTimeFormatter.ofPattern("d MMM yyyy"); DateTimeFormatter test = DateTimeFormatter.ofPattern("d MMM yyyy");
Locale fmtLocale = Locale.getDefault(Locale.Category.FORMAT);
assertEquals(test.format(LocalDate.of(2012, 6, 30)), "30 " + assertEquals(test.format(LocalDate.of(2012, 6, 30)), "30 " +
Month.JUNE.getDisplayName(TextStyle.SHORT, Locale.getDefault()) + " 2012"); Month.JUNE.getDisplayName(TextStyle.SHORT, fmtLocale) + " 2012");
assertEquals(test.getLocale(), Locale.getDefault()); assertEquals(test.getLocale(), fmtLocale, "Locale.Category.FORMAT");
} }
@Test(expectedExceptions=IllegalArgumentException.class) @Test(expectedExceptions=IllegalArgumentException.class)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册