Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite branch -- BulbsInPathContradictionRuleTest #674

Merged
merged 42 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
50ba53f
Region Based Changes (#559)
19690ao Sep 29, 2023
f3dbafb
Short Truth Table Puzzle Editor (#451)
charlestian23 Sep 29, 2023
bcb8629
Have null changes be valid and fix IsolatedBlackContradicitonRule err…
04vmatsibekker Sep 29, 2023
f1c7985
Fixed a bug
charlestian23 Oct 3, 2023
7ff8873
Merge pull request #625 from charlestian23/dev
Chase-Grajeda Oct 3, 2023
473300c
Update BlackTile.java
charlestian23 Oct 3, 2023
0832621
Added unknown tile stuff
charlestian23 Oct 3, 2023
23d6558
ID error
charlestian23 Oct 3, 2023
145e316
Some Fixes to Recently Discussed UX Bugs (#563)
hansongu123 Oct 3, 2023
1357dbd
Oops pushed the wrong file
charlestian23 Oct 3, 2023
f3ba447
Number Tile working
charlestian23 Oct 3, 2023
e03cdf9
Merge branch 'dev' into dev
charlestian23 Oct 3, 2023
b603f1a
Update Exporter (#627)
ThisMatt Oct 6, 2023
47a57d2
Merge branch 'dev' into dev
charlestian23 Oct 10, 2023
ef1be26
Create run-tests.yml
charlestian23 Oct 10, 2023
20ff3dc
Update run-tests.yml
charlestian23 Oct 10, 2023
4df8313
Update run-tests.yml
charlestian23 Oct 10, 2023
60c99db
Update run-tests.yml
charlestian23 Oct 10, 2023
84517f8
Update run-tests.yml
charlestian23 Oct 10, 2023
57532c4
Windows things
charlestian23 Oct 10, 2023
aac1ed4
Added print messages
charlestian23 Oct 10, 2023
25d559a
More Windows things
charlestian23 Oct 10, 2023
48479a6
Debugging
charlestian23 Oct 10, 2023
28c06bc
Update run-tests.yml
charlestian23 Oct 10, 2023
7377a15
Update run-tests.yml
charlestian23 Oct 10, 2023
49fb14f
Maybe this will work now?
charlestian23 Oct 10, 2023
cfeee6a
Didn't work
charlestian23 Oct 10, 2023
7b49c11
Update run-tests.yml
charlestian23 Oct 10, 2023
4029b7c
Update run-tests.yml
charlestian23 Oct 10, 2023
19f0c26
Create DummyTest.java
charlestian23 Oct 10, 2023
f2b1cfa
Added another dummy test
charlestian23 Oct 10, 2023
7fd577b
Update run-tests.yml
charlestian23 Oct 10, 2023
8675598
Update run-tests.yml
charlestian23 Oct 10, 2023
4bd1787
Deleted the dummy tests
charlestian23 Oct 10, 2023
a52b65d
Merge pull request #634 from charlestian23/github-actions-test-suite
Chase-Grajeda Oct 10, 2023
f98bc7d
Merge branch 'dev' into dev
Chase-Grajeda Oct 10, 2023
97be2be
Merge pull request #629 from charlestian23/dev
Chase-Grajeda Oct 10, 2023
6f6572e
BulbsInPathContradictionRuleTest looks good. I added one more functio…
pitbull51067 Oct 20, 2023
8070df7
Merge branch 'master' into Test-Suite-Branch
Chase-Grajeda Oct 27, 2023
07422af
I think I might have run into a problem on the testing function. I wi…
pitbull51067 Oct 31, 2023
fc08c8a
I made another puzzle and test case to check what would happen if the…
pitbull51067 Nov 7, 2023
f9764aa
I made another puzzle and test case to check what would happen if the…
pitbull51067 Nov 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public void BulbsInPathContradictionRule_LightInHorizontalPath() throws InvalidF
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(2, 0)));


Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 1)));
}

Expand Down Expand Up @@ -67,4 +68,19 @@ public void BulbsInPathContradictionRule_BlockInVerticalPath() throws InvalidFil

Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
}

@Test
public void BulbsInPathContradictionRule_BlockInHorizontalPath() throws InvalidFileFormatException{
TestUtilities.importTestBoard("puzzles/lightup/rules/BulbsInPathContradictionRule/BlockInHorizontalPath", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);

LightUpBoard board = (LightUpBoard) transition.getBoard();
Assert.assertNotNull(RULE.checkContradiction(board));
Assert.assertNotNull(RULE.checkContradictionAt(board,board.getCell(0,0)));
Assert.assertNotNull(RULE.checkContradictionAt(board,board.getCell(2,0)));
Assert.assertNotNull(RULE.checkContradictionAt(board,board.getCell(1,1)));

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ public static void setUp() {
lightUp = new LightUp();
}

@Test
@Test
//extensive full testing of null and non-null in a 5x5 board
public void FullLightTest() throws InvalidFileFormatException {
TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/FullLightTest", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
transition.setRule(RULE);

LightUpBoard board = (LightUpBoard) transition.getBoard();
//confirm there is a contradiction somewhere on the board
Expand All @@ -36,21 +36,21 @@ public void FullLightTest() throws InvalidFileFormatException {
//confirm it is impossible to light up these squares
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(1, 3)));
Assert.assertNull(RULE.checkContradictionAt(board, board.getCell(3, 3)));

//confirm these are not required to be lit because they are already lit or unable to be
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(3, 2)));
}

@Test
@Test
//simple contradiction testing for null and non-null in a 3x3 board
public void CannotLightMiddleTest() throws InvalidFileFormatException {
TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/CannotLight", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);
transition.setRule(RULE);

LightUpBoard board = (LightUpBoard) transition.getBoard();
//confirm there is a contradiction somewhere on the board
Expand All @@ -68,4 +68,24 @@ public void CannotLightMiddleTest() throws InvalidFileFormatException {
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 2)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(2, 1)));
}

@Test
public void CanLightTest() throws InvalidFileFormatException {
TestUtilities.importTestBoard("puzzles/lightup/rules/CannotLightACellContradictionRule/CanLightTest", lightUp);
TreeNode rootNode = lightUp.getTree().getRootNode();
TreeTransition transition = rootNode.getChildren().get(0);
transition.setRule(RULE);

LightUpBoard board = (LightUpBoard) transition.getBoard();
//confirm there is not a contradiction somewhere on the board
Assert.assertNotNull(RULE.checkContradiction(board));

//confirm that these cells can be lit, are already lit, or that they are just black blocks
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 3)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(3, 3)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(0, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 1)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(1, 0)));
Assert.assertNotNull(RULE.checkContradictionAt(board, board.getCell(3, 2)));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Legup>
<puzzle name="LightUp">
<board width="3" height="3">
<cells>
<cell value="-4" x="0" y="0"/>
<cell value="-1" x="1" y="0"/>
<cell value="-4" x="2" y="0"/>
</cells>
</board>
</puzzle>
</Legup>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Legup>
<puzzle name="LightUp">
<board width="5" height="5">
<cells>
<cell value="-2" x="1" y="0"/>
<cell value="-4" x="2" y="1"/>
<cell value="-4" x="0" y="4"/>
<cell value="-4" x="4" y="2"/>
<cell value="-2" x="1" y="1"/>
<cell value="-1" x="1" y="2"/>
<cell value="-1" x="2" y="3"/>
<cell value="-2" x="1" y="3"/>
<cell value="-3" x="3" y="2"/>
<cell value="-3" x="3" y="3"/>
</cells>
</board>
</puzzle>
</Legup>
Loading