This commit is contained in:
Looly
2022-11-10 10:37:54 +08:00
parent b7d91489f4
commit c69d41e72d
8 changed files with 62 additions and 41 deletions

View File

@@ -0,0 +1,13 @@
package cn.hutool.core.date.chinese;
import org.junit.Assert;
import org.junit.Test;
public class IssueI5YB1ATest {
@Test
public void chineseDateTest() {
// 四月非闰月因此isLeapMonth参数无效
final ChineseDate date = new ChineseDate(2023, 4, 8, true);
Assert.assertEquals("2023-05-26 00:00:00", date.getGregorianDate().toString());
}
}

View File

@@ -12,13 +12,13 @@ public class InternUtilTest {
@SuppressWarnings("StringOperationCanBeSimplified")
@Test
public void weakTest(){
final Interner<String> interner = InternUtil.createWeakInterner();
final Intern<String> intern = InternUtil.ofWeak();
final String a1 = RandomUtil.randomString(RandomUtil.randomInt(100));
final String a2 = new String(a1);
Assert.assertNotSame(a1, a2);
Assert.assertSame(interner.intern(a1), interner.intern(a2));
Assert.assertSame(intern.intern(a1), intern.intern(a2));
}
}