Skip to content

Commit

Permalink
feat: 삼각 달팽이 두번째 풀이 테스트 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
rldnrl committed Oct 7, 2023
1 parent ecc8964 commit 63d9e7f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/programmers/lv2/TriangleSnailTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,19 @@ void solutionTest() {
int[] result3 = new int[]{1,2,15,3,16,14,4,17,21,13,5,18,19,20,12,6,7,8,9,10,11};
Assertions.assertArrayEquals(TriangleSnail.solution(input3), result3);
}

@Test
void solution2Test() {
int input1 = 4;
int[] result1 = new int[]{1,2,9,3,10,8,4,5,6,7};
Assertions.assertArrayEquals(TriangleSnail.solution2(input1), result1);

int input2 = 5;
int[] result2 = new int[]{1,2,12,3,13,11,4,14,15,10,5,6,7,8,9};
Assertions.assertArrayEquals(TriangleSnail.solution2(input2), result2);

int input3 = 6;
int[] result3 = new int[]{1,2,15,3,16,14,4,17,21,13,5,18,19,20,12,6,7,8,9,10,11};
Assertions.assertArrayEquals(TriangleSnail.solution2(input3), result3);
}
}

0 comments on commit 63d9e7f

Please sign in to comment.