Merge pull request #885 from Diffblue-benchmarks/add-NumberUtils-tests

Add unit tests for us.codecraft.webmagic.utils.NumberUtils
master
Sutra Zhou 2020-05-29 14:49:12 +08:00 committed by GitHub
commit f24410d7bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -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));
}
}