mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
add test
This commit is contained in:
parent
c2641bf97b
commit
5a2fe05346
@ -15,6 +15,9 @@ package org.dromara.hutool.core.comparator;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
/**
|
||||
@ -134,4 +137,12 @@ public class VersionComparatorTest {
|
||||
final int compare = VersionComparator.INSTANCE.compare("V1", "A1");
|
||||
assertTrue(compare > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void compareFileNameTest() {
|
||||
final String[] a = {"abc2.doc", "abc1.doc", "abc12.doc"};
|
||||
Arrays.sort(a, VersionComparator.INSTANCE);
|
||||
|
||||
assertArrayEquals(new String[]{"abc1.doc", "abc2.doc", "abc12.doc"}, a);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user