This commit is contained in:
Looly 2024-10-29 19:47:23 +08:00
parent e108aa18ce
commit 93e113399b

View File

@ -1,8 +1,11 @@
package cn.hutool.core.date;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.time.format.TextStyle;
import java.util.Calendar;
import java.util.Locale;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
@ -68,4 +71,10 @@ public class MonthTest {
month = Month.of(java.time.Month.FEBRUARY);
assertEquals(Month.FEBRUARY, month);
}
@Test
void getDisplayNameTest() {
final String displayName = Month.FEBRUARY.getDisplayName(TextStyle.SHORT, Locale.US);
Assertions.assertEquals("Feb", displayName);
}
}