Gather data
This commit is contained in:
@@ -29,35 +29,36 @@ public class MainTest {
|
||||
grid.setCharAt(r, c, C_DASH);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Test set/get
|
||||
grid.setCharAt(0, 0, 'A');
|
||||
grid.setCharAt(1, 2, '5');
|
||||
grid.setCharAt(2, 3, 'Z');
|
||||
|
||||
|
||||
Assertions.assertEquals('A', grid.getCharAt(0, 0));
|
||||
Assertions.assertEquals('5', grid.getCharAt(1, 2));
|
||||
Assertions.assertEquals('Z', grid.getCharAt(2, 3));
|
||||
Assertions.assertEquals(C_DASH, grid.getCharAt(1, 1));
|
||||
|
||||
|
||||
// Test isLetterAt
|
||||
Assertions.assertTrue(grid.isLetterAt(0, 0));
|
||||
Assertions.assertFalse(grid.isLetterAt(1, 2));
|
||||
Assertions.assertTrue(grid.isLetterAt(2, 3));
|
||||
Assertions.assertFalse(grid.isLetterAt(1, 1));
|
||||
|
||||
|
||||
// Test isDigitAt
|
||||
Assertions.assertFalse(grid.isDigitAt(0, 0));
|
||||
Assertions.assertTrue(grid.isDigitAt(1, 2));
|
||||
Assertions.assertEquals(5, grid.digitAt(1, 2));
|
||||
Assertions.assertFalse(grid.isDigitAt(2, 3));
|
||||
Assertions.assertFalse(grid.isDigitAt(1, 1));
|
||||
|
||||
|
||||
// Test isLettercell
|
||||
Assertions.assertTrue(grid.isLettercell(0, 0)); // 'A' is letter
|
||||
Assertions.assertFalse(grid.isLettercell(1, 2)); // '5' is digit
|
||||
Assertions.assertTrue(grid.isLettercell(1, 1)); // '#' is lettercell
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testGridDeepCopy() {
|
||||
var grid = new Grid(new byte[2 * 2], 2, 2);
|
||||
@@ -65,7 +66,7 @@ public class MainTest {
|
||||
grid.setCharAt(0, 1, 'B');
|
||||
grid.setCharAt(1, 0, 'C');
|
||||
grid.setCharAt(1, 1, 'D');
|
||||
|
||||
|
||||
var copy = grid.deepCopyGrid();
|
||||
Assertions.assertEquals('A', copy.getCharAt(0, 0));
|
||||
|
||||
@@ -73,8 +74,7 @@ public class MainTest {
|
||||
Assertions.assertEquals('X', copy.getCharAt(0, 0));
|
||||
Assertions.assertEquals('A', grid.getCharAt(0, 0)); // Original should be unchanged
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testMini() {
|
||||
var grid = new Grid(new byte[3 * 3], 3, 3);
|
||||
|
||||
Reference in New Issue
Block a user