mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
Add more tests (#3601)
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.thealgorithms.divideandconquer;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class BinaryExponentiationTest {
|
||||
|
||||
@Test
|
||||
public void testCalculatePower() {
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 10000000));
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 100000000));
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 1000000000));
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 10000000000L));
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 100000000000L));
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 1000000000000L));
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 10000000000000L));
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 100000000000000L));
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 1000000000000000L));
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 10000000000000000L));
|
||||
assertEquals(1, BinaryExponentiation.calculatePower(1, 100000000000000000L));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPower() {
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 10000000));
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 100000000));
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 1000000000));
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 10000000000L));
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 100000000000L));
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 1000000000000L));
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 10000000000000L));
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 100000000000000L));
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 1000000000000000L));
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 10000000000000000L));
|
||||
assertEquals(1, new BinaryExponentiation().power(1, 100000000000000000L));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user