MCPcopy Create free account
hub / github.com/TheAlgorithms/Java / testPow

Method testPow

src/test/java/com/thealgorithms/maths/PowTest.java:11–15  ·  view source on GitHub ↗
(int base, int exponent, long expected)

Source from the content-addressed store, hash-verified

9
10public class PowTest {
11 @ParameterizedTest
12 @CsvSource({"2, 0, 1", "0, 2, 0", "2, 10, 1024", "10, 2, 100", "5, 3, 125", "3, 4, 81"})
13 void testPow(int base, int exponent, long expected) {
14 assertEquals(expected, Pow.pow(base, exponent), "Failed for base: " + base + " and exponent: " + exponent);
15 }
16
17 @Test
18 void testPowThrowsExceptionForNegativeExponent() {

Callers

nothing calls this directly

Calls 1

powMethod · 0.95

Tested by

no test coverage detected