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

Tree Tent Test Suite #775

Merged
merged 35 commits into from
May 5, 2024
Merged

Conversation

jadeandtea
Copy link
Collaborator

@jadeandtea jadeandtea commented Mar 27, 2024

Description

Updates the Tree Tent Test suite

  • Improved FillInRow Case Rule generation
  • Test cases for TentForTree Direct Rule (incomplete)
  • Test cases for FillInRow Case Rule
  • Test cases for LinkTent Case Rule

Bug Fixes

  • Fix Puzzle Editor Functionality
  • Lines placed while solving are now saved and reopened properly
  • Allows for applying TreeTent case rules on nodes apart from the root
  • Allows for puzzles with more rows than columns

Closes #608, #609, #610, #611, #757, #768

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (improvement to an already existing feature)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

I was able to create and reopen TreeTent puzzles with various sizes. After making a few moves while solving a puzzle, placing a line, and saving the puzzle, I was able to reopen it.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

One valid case of connecting a tree to a tent
One invalid case of connecting a tree to a tent when there is another valid tent
Looks like the case rule was implemented incorrectly :/
Actually case generator works properly
When the clue is that there are 0 tents, the case returned should be equivalent to FinishWithGrass.
Expected to create four cases, each one connecting a line between the tree in the center and one of the four surrounding trees.
With one tree, one case is created.
With no trees, no cases are created.
With diagonal trees, no cases are created.
Removed double-calling setCell due to custom and super mouseReleased
Similar test cases to LinkTentCaseRule
- Make sure diagonal tents have no bearing on cases
- Make sure no tents around the tree fails
- One tent should connect to the correct tree
- Two tents should create two cases
- No other cases to check, as there cannot be more than two tents around a tree; otherwise, the tents would touch
Rewrote recursive generate board function to be slightly more optimized
Fixes a bug where you couldn't apply the FillInRow Case Rule on a child node
When checking the proof tree, the Puzzle Importer only checks for changed cells. However, for TreeTent, the user can create lines, which cannot be saved as a "cell" object. Now, an importer class can override the getImporterElements function to specify what types of changes the board may experience.
Simple mistake in calculation of index
@charlestian23 charlestian23 marked this pull request as draft March 27, 2024 17:19
@charlestian23
Copy link
Collaborator

Converting this PR to a draft since it seems to be WIP

The Ubuntu and Checkstyle Autocompilers have trouble opening this file for some reason
@jadeandtea jadeandtea changed the title Tree Tent Test Suite (WIP) Tree Tent Test Suite Apr 16, 2024
@jadeandtea
Copy link
Collaborator Author

I have no idea why the Ubuntu and Checkstyle actions are failing when loading the file for one of the FillInRowCaseRule tests. I'll just comment it out for now.

@jadeandtea jadeandtea marked this pull request as ready for review April 16, 2024 20:56
Copy link
Collaborator

@charlestian23 charlestian23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests work, going to merge

@charlestian23 charlestian23 merged commit 8b2397a into Bram-Hub:dev May 5, 2024
9 checks passed
This was referenced Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants