mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-05 00:14:33 +08:00
16 lines
503 B
Java
16 lines
503 B
Java
package com.thealgorithms.bitmanipulation;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
import org.junit.jupiter.params.ParameterizedTest;
|
|
import org.junit.jupiter.params.provider.CsvSource;
|
|
|
|
public class OneBitDifferenceTest {
|
|
|
|
@ParameterizedTest
|
|
@CsvSource({"7, 5, true", "3, 2, true", "10, 8, true", "15, 15, false", "4, 1, false"})
|
|
void testDifferByOneBit(int x, int y, boolean expected) {
|
|
assertEquals(expected, OneBitDifference.differByOneBit(x, y));
|
|
}
|
|
}
|