Skip to content

Commit

Permalink
test: cyclic rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
rldnrl committed Oct 20, 2023
1 parent d11c0f6 commit c604988
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/codility/CyclicRotationTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package codility;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class CyclicRotationTest {
@Test
void cyclicRotationTest() {
int[] A1 = new int[]{3, 8, 9, 7, 6};
int K1 = 3;
int[] result1 = {9, 7, 6, 3, 8};
Assertions.assertArrayEquals(CyclicRotation.solution(A1, K1), result1);

int[] A2 = new int[]{0, 0, 0};
int K2 = 1;
int[] result2 = {0, 0, 0};
Assertions.assertArrayEquals(CyclicRotation.solution(A2, K2), result2);
}
}

0 comments on commit c604988

Please sign in to comment.