Skip to content

Commit 43c9b22

Browse files
committed
Fix
1 parent e5e5960 commit 43c9b22

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/test/java/com/thealgorithms/others/SudokuTest.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static Stream<Arguments> provideSudokuBoards() {
3131
/**
3232
* Parameterized test to check the solution of a Sudoku board.
3333
*
34-
* @param board The initial Sudoku board to solve.
34+
* @param board The initial Sudoku board to solve.
3535
* @param expectedResult Expected result - true if solvable, false otherwise.
3636
*/
3737
@ParameterizedTest
@@ -43,29 +43,30 @@ void testSolveSudoku(int[][] board, boolean expectedResult) {
4343
}
4444

4545
/**
46-
* Parameterized test to check if the number can be safely placed at a given cell.
46+
* Parameterized test to check if the number can be safely placed at a given
47+
* cell.
4748
*
48-
* @param board The Sudoku board to check.
49-
* @param row The row index of the cell.
50-
* @param col The column index of the cell.
51-
* @param num The number to place.
49+
* @param board The Sudoku board to check.
50+
* @param row The row index of the cell.
51+
* @param col The column index of the cell.
52+
* @param num The number to place.
5253
* @param expectedResult True if the placement is valid, false otherwise.
5354
*/
5455
@ParameterizedTest
55-
@CsvSource({"'5,3,0,0,7,0,0,0,0;6,0,0,1,9,5,0,0,0;0,9,8,0,0,0,0,6,0;8,0,0,0,6,0,0,0,3;4,0,0,8,0,3,0,0,1;7,0,0,0,2,0,0,0,6;0,6,0,0,0,0,2,8,0;0,0,0,4,1,9,0,0,5;0,0,0,0,8,0,0,7,9', 0, 2, 4, false",
56+
@CsvSource({
57+
"'5,3,0,0,7,0,0,0,0;6,0,0,1,9,5,0,0,0;0,9,8,0,0,0,0,6,0;8,0,0,0,6,0,0,0,3;4,0,0,8,0,3,0,0,1;7,0,0,0,2,0,0,0,6;0,6,0,0,0,0,2,8,0;0,0,0,4,1,9,0,0,5;0,0,0,0,8,0,0,7,9', 0, 2, 4, false",
5658

57-
58-
"'5,3,0,0,7,0,0,0,0;6,0,0,1,9,5,0,0,0;0,9,8,0,0,0,0,6,0;8,0,0,0,6,0,0,0,3;4,0,0,8,0,3,0,0,1;7,0,0,0,2,0,0,0,6;0,6,0,0,0,0,2,8,0;0,0,0,4,1,9,0,0,5;0,0,0,0,8,0,0,7,9', 0, 2, 9, true"})
59+
"'5,3,0,0,7,0,0,0,0;6,0,0,1,9,5,0,0,0;0,9,8,0,0,0,0,6,0;8,0,0,0,6,0,0,0,3;4,0,0,8,0,3,0,0,1;7,0,0,0,2,0,0,0,6;0,6,0,0,0,0,2,8,0;0,0,0,4,1,9,0,0,5;0,0,0,0,8,0,0,7,9', 0, 2, 9, true" })
5960

60-
void
61-
testIsSafe(String boardString, int row, int col, int num, boolean expectedResult) {
61+
void testIsSafe(String boardString, int row, int col, int num, boolean expectedResult) {
6262
int[][] board = parseBoard(boardString);
6363
assertEquals(expectedResult, Sudoku.isSafe(board, row, col, num));
6464
}
6565

6666
/**
6767
* Helper method to parse a board from a string.
68-
* The board string is expected to have semicolon-separated rows with comma-separated values.
68+
* The board string is expected to have semicolon-separated rows with
69+
* comma-separated values.
6970
*
7071
* @param boardString The board represented as a string.
7172
* @return The parsed 2D int array representing the Sudoku board.

0 commit comments

Comments
 (0)