Comprehensive Unit Testing and small Core Logic Refactoring#120
Open
pzauner wants to merge 6 commits intopalsoftware:mainfrom
Open
Comprehensive Unit Testing and small Core Logic Refactoring#120pzauner wants to merge 6 commits intopalsoftware:mainfrom
pzauner wants to merge 6 commits intopalsoftware:mainfrom
Conversation
…ügt sowie Robolectric integriert
fe7c448 to
35c9b8e
Compare
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.
This PR introduces a robust testing framework and significantly improves the reliability of the keyboard's core logic, focusing on modifier states, input context detection, and the suggestion engine.
Test Infrastructure
New Unit Tests
Implemented a comprehensive suite of tests to prevent regressions in core features:
Core Logic Improvements
This is the only place where the actual structure of the codebase was modified. This was performed for two reasons:
a) To enable testing in the first place. Testing private methods via reflection is problematic in Kotlin when the class performs strict null-checks on its constructor dependencies (such as DictionaryRepository). Moving the pure logic into a companion object allows for clean unit tests without requiring complex mocks.
b) The splitApostropheWord method was hard-capped to prefixes of at most 3 characters (e.g., l', un', all'). This caused longer Italian elisions like dell' or nell' to be bypassed by the specialized correction logic."
Change Stats