diff --git a/src/main/java/com/Others/FastPower.java b/src/main/java/com/others/FastPower.java similarity index 100% rename from src/main/java/com/Others/FastPower.java rename to src/main/java/com/others/FastPower.java diff --git a/src/test/java/com/others/FastPowerTest.java b/src/test/java/com/others/FastPowerTest.java new file mode 100644 index 00000000..af38477f --- /dev/null +++ b/src/test/java/com/others/FastPowerTest.java @@ -0,0 +1,9 @@ +package src.test.java.com.others; + +/** + * @author bingo + * @since 2019/5/10 + */ + +public class FastPowerTest { +} diff --git a/src/main/java/com/Others/FastPowerTest.java b/src/test/java/com/others/FastPowerTest.java___jb_tmp___ similarity index 52% rename from src/main/java/com/Others/FastPowerTest.java rename to src/test/java/com/others/FastPowerTest.java___jb_tmp___ index bd61704b..4a086562 100644 --- a/src/main/java/com/Others/FastPowerTest.java +++ b/src/test/java/com/others/FastPowerTest.java___jb_tmp___ @@ -1,6 +1,7 @@ -package src.main.java.com.Others; +package src.test.java.com.others; -import org.junit.*; +import org.junit.Test; +import src.main.java.com.others.FastPower; import java.math.BigInteger; @@ -8,23 +9,25 @@ import static org.junit.Assert.*; public class FastPowerTest { - void testLong(long n, long k, long m){ - long result = FastPower.calculate(n,k,m); + @Test + void testLong(long n, long k, long m) { + long result = FastPower.calculate(n, k, m); assertEquals(result, BigInteger.valueOf(n).modPow(BigInteger.valueOf(k), BigInteger.valueOf(m)).longValue()); } - void testBigInteger(BigInteger n, BigInteger k, BigInteger m){ - BigInteger result = FastPower.calculate(n,k,m); - assertEquals(result, n.modPow(k,m)); + @Test + void testBigInteger(BigInteger n, BigInteger k, BigInteger m) { + BigInteger result = FastPower.calculate(n, k, m); + assertEquals(result, n.modPow(k, m)); } @Test public void test() { - testLong(2,2,10); - testLong(100,1000,20); - testLong(123456,123456789,234); + testLong(2, 2, 10); + testLong(100, 1000, 20); + testLong(123456, 123456789, 234); - testBigInteger(BigInteger.TEN,BigInteger.TEN, BigInteger.valueOf(4)); + testBigInteger(BigInteger.TEN, BigInteger.TEN, BigInteger.valueOf(4)); testBigInteger(new BigInteger("123456"), new BigInteger("123456789"), new BigInteger("234")); testBigInteger(new BigInteger("123456789101112"), new BigInteger("12345678910111213"), new BigInteger("567890"));