Merge pull request #885 from Diffblue-benchmarks/add-NumberUtils-tests
Add unit tests for us.codecraft.webmagic.utils.NumberUtilspull/939/head
commit
f24410d7bf
@ -0,0 +1,16 @@
|
|||||||
|
package us.codecraft.webmagic.utils;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class NumberUtilsTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCompareLong() {
|
||||||
|
Assert.assertEquals(0, NumberUtils.compareLong(0L, 0L));
|
||||||
|
Assert.assertEquals(1, NumberUtils.compareLong(9L, 0L));
|
||||||
|
Assert.assertEquals(-1, NumberUtils.compareLong(0L, 9L));
|
||||||
|
Assert.assertEquals(-1, NumberUtils.compareLong(-9L, 0L));
|
||||||
|
Assert.assertEquals(1, NumberUtils.compareLong(0L, -9L));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue