Add tests to CropsNH and improve common utilities - #242
Draft
C0bra5 wants to merge 21 commits into
Draft
Conversation
C0bra5
marked this pull request as ready for review
August 13, 2026 06:47
C0bra5
marked this pull request as draft
August 13, 2026 06:47
C0bra5
marked this pull request as ready for review
August 13, 2026 06:49
C0bra5
marked this pull request as draft
August 13, 2026 22:05
C0bra5
marked this pull request as ready for review
August 13, 2026 22:09
C0bra5
marked this pull request as draft
August 18, 2026 06:39
Collaborator
Author
|
I'll draft this since I'll be adding more tests. This PR wasn't necessarily intended for 2.9, but I'll mark it as frozen for now since the changes will get large enough that it won't be a good idea to merge it into a feature-frozen project going forward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds 2 unit-testing modules to the codebase:
testmodule allows us to test components that don't require a loaded game.functionalTestmodule allows us to test components that require a loaded game.The common utility improvements mostly come from unit tests revealing odd edge cases, but there are a few improvements here and there since I'll be using this PR to add some things I'm targeting for 2.10, as I'm not planning to merge this PR for 2.9.
Summary of the more notable common utility changes
removeandremoveWildcardfunctions to help remove things during load.SeedStats.DEFAULT_ANALYZEDis nowSeedStats.DEFAULT_ANALYZED_READONLY, and a constructor that takes only the analyzed status has been added to handle cases where the default value should remain mutable without affecting the readonly instance.CropsNHUtils.getFallbackCrop.Test writing progress
With the introduction of these modules, I'm looking to start by adding unit tests for all the following items:
Checklist